@@ -12,17 +12,22 @@ permissions:
1212jobs :
1313 build :
1414 runs-on : ubuntu-latest
15+ outputs :
16+ distro : ${{ steps.distro_check.outputs.distro }}
1517 steps :
1618 - name : Checkout
1719 uses : actions/checkout@v4
1820 with :
1921 submodules : recursive
2022 fetch-depth : 0
23+ - name : Test
24+ run : |
25+ make test
2126 - name : Build
2227 run : |
2328 sudo apt-get update
2429 sudo apt-get build-dep --no-install-recommends -y .
25- make deb
30+ make all deb
2631 - name : Workaround actions/upload-artifact#176
2732 run : |
2833 echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
@@ -32,10 +37,20 @@ jobs:
3237 name : ${{ github.event.repository.name }}
3338 path : |
3439 ${{ env.artifacts_path }}/*.deb
40+ - name : Check if the latest version is releasable
41+ id : distro_check
42+ run : |
43+ version="$(dpkg-parsechangelog -S Version)"
44+ if [[ -n "$(git tag -l "$version")" ]]
45+ then
46+ echo "distro=UNRELEASED" >> "$GITHUB_OUTPUT"
47+ else
48+ echo "distro=$(dpkg-parsechangelog -S Distribution)" >> "$GITHUB_OUTPUT"
49+ fi
3550 release :
3651 runs-on : ubuntu-latest
3752 needs : build
38- if : ${{ github.event_name == 'workflow_dispatch ' && github.ref_name == 'main ' }}
53+ if : ${{ github.event_name != 'pull_request ' && needs.build.outputs.distro != 'UNRELEASED ' }}
3954 steps :
4055 - name : Checkout
4156 uses : actions/checkout@v4
4560 - uses : actions/download-artifact@v4
4661 with :
4762 name : ${{ github.event.repository.name }}
48- - name : Check if the latest version is releasable
63+ path : .artifacts
64+ - name : Prepare for release
4965 run : |
5066 version="$(dpkg-parsechangelog -S Version)"
5167 echo "version=$version" >> $GITHUB_ENV
@@ -54,32 +70,25 @@ jobs:
5470 echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV
5571 echo '```' >> $GITHUB_ENV
5672 echo "EOF" >> $GITHUB_ENV
57- if [[ -n "$(git tag -l "$version")" ]]
58- then
59- echo "distro=UNRELEASED" >> $GITHUB_ENV
60- else
61- echo "distro=$(dpkg-parsechangelog -S Distribution)" >> $GITHUB_ENV
62- fi
6373 echo "$version" > VERSION
6474 if [[ -f pkg.conf.template ]]
6575 then
6676 sed "s/VERSION/$(dpkg-parsechangelog -S Version)/g" pkg.conf.template > pkg.conf
6777 fi
6878 - name : Release
69- if : env.distro != 'UNRELEASED'
7079 uses : softprops/action-gh-release@v2
7180 with :
7281 tag_name : ${{ env.version }}
7382 body_path : README.md
7483 token : ${{ secrets.GITHUB_TOKEN }}
75- target_commitish : master
84+ target_commitish : ${{ github.ref_name }}
7685 draft : false
77- fail_on_unmatched_files : true
86+ fail_on_unmatched_files : false
7887 files : |
79- *.deb
88+ .artifacts/**/*.deb
89+ pkg.conf
8090 VERSION
8191 - name : Append changelog
82- if : env.distro != 'UNRELEASED'
8392 uses : softprops/action-gh-release@v2
8493 with :
8594 tag_name : ${{ env.version }}
8897 ${{ env.changes }}
8998 append_body : true
9099 - name : Update Test repos
91- if : env.distro != 'UNRELEASED'
92100 uses : radxa-repo/update-repo-action@main
93101 with :
94102 test-repo : true
0 commit comments