-
-
Notifications
You must be signed in to change notification settings - Fork 214
86 lines (84 loc) · 3.14 KB
/
new-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build and publish new release on version tag
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
make-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get clean tag name
id: clean_tag
run: echo "tag=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')" >> $GITHUB_OUTPUT
- name: Get changelog
run: python scripts/get_changelog.py --version ${{ steps.clean_tag.outputs.tag }} > ./body-file.txt
# Just in case changelogs won't work out
# - name: Get tag message
# id: tag_message
# run: echo "name=message=$(git tag -l --format='%(contents)' ${{ github.ref }})" >> $GITHUB_OUTPUT
- name: Create GH-Release
uses: softprops/action-gh-release@v1
with:
body_path: ./body-file.txt
fail_on_unmatched_files: true
build:
needs: make-release
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Get clean tag name
id: clean_tag
run: echo "tag=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')" >> $GITHUB_OUTPUT
- name: Get exe name
id: exe_name
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
echo "name=gpth-linux" >> $GITHUB_OUTPUT
elif [ "$RUNNER_OS" == "Windows" ]; then
echo "name=gpth-windoza.exe" >> $GITHUB_OUTPUT
elif [ "$RUNNER_OS" == "macOS" ]; then
echo "name=gpth-macos" >> $GITHUB_OUTPUT
else
echo "Unknown OS: $RUNNER_OS"
exit 69
fi
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- name: Build exe
run: dart compile exe bin/gpth.dart -o ./${{ steps.exe_name.outputs.name }}
- name: Code sign a windoza exe file
if: matrix.os == 'windows-latest'
uses: dlemstra/code-sign-action@v1
with:
# Note: this is a self-signed certificate that i generated on my computer
# This is worthless i think, since windoza still get angry, but best i can do,
# because proper certificates cost money (a lot :/ )
certificate: ${{ secrets.WINDOZA_CERT_BASE64 }}
password: ${{ secrets.WINDOZA_CERT_PASSWORD }}
folder: '.'
- name: Add files to GH-Release
uses: softprops/action-gh-release@v1
with:
# this supports globs :>
files: ./gpth-*
fail_on_unmatched_files: true
# if linux, upload to aur
- name: Generate PKGBUILD
if: matrix.os == 'ubuntu-latest'
run: ./scripts/gen-pkgbuild.bash ./${{ steps.exe_name.outputs.name }}
- name: Upload to AUR
if: matrix.os == 'ubuntu-latest'
uses: KSXGitHub/github-actions-deploy-aur@v2
with:
pkgname: gpth-bin
pkgbuild: ./PKGBUILD
commit_username: 'TheLastGimbus'
commit_email: '[email protected]'
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: ${{ steps.clean_tag.outputs.tag }}
test: true