Update changelog for 0.3.31 release #140
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Release | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: pre-commit check | |
run: | | |
pip install pre-commit | |
if ! pre-commit run --all-files --show-diff-on-failure | |
then | |
echo '' | |
echo '=== Code style issue detected! ===' | |
echo 'Suggest changes are listed above.' | |
echo 'Please install pre-commit and run `pre-commit run --all-files` to fix it.' | |
echo 'Strongly recommended to run `pre-commit install` to catch issues before pushing.' | |
echo 'You can learn more abour pre-commit from https://pre-commit.com/' | |
exit 1 | |
fi | |
- name: Test | |
run: | | |
make test | |
- name: Build | |
run: | | |
sudo apt-get update | |
sudo apt-get build-dep --no-install-recommends -y . | |
make all deb | |
- name: Workaround actions/upload-artifact#176 | |
run: | | |
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: | | |
${{ env.artifacts_path }}/*.deb | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'main' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: ${{ github.event.repository.name }} | |
- name: Check if the latest version is releasable | |
run: | | |
version="$(dpkg-parsechangelog -S Version)" | |
echo "version=$version" >> $GITHUB_ENV | |
echo "changes<<EOF" >> $GITHUB_ENV | |
echo '```' >> $GITHUB_ENV | |
echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV | |
echo '```' >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
if [[ -n "$(git tag -l "$version")" ]] | |
then | |
echo "distro=UNRELEASED" >> $GITHUB_ENV | |
else | |
echo "distro=$(dpkg-parsechangelog -S Distribution)" >> $GITHUB_ENV | |
fi | |
echo "$version" > VERSION | |
- name: Release | |
if: env.distro != 'UNRELEASED' | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.version }} | |
body_path: README.md | |
token: ${{ secrets.GITHUB_TOKEN }} | |
target_commitish: main | |
draft: false | |
fail_on_unmatched_files: false | |
files: | | |
*.deb | |
pkg.conf | |
VERSION | |
- name: Append changelog | |
if: env.distro != 'UNRELEASED' | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.version }} | |
body: | | |
## Changelog for ${{ env.version }} | |
${{ env.changes }} | |
append_body: true | |
- name: Update Test repos | |
if: env.distro != 'UNRELEASED' | |
uses: radxa-repo/update-repo-action@main | |
with: | |
test-repo: true | |
token: ${{ secrets.RADXA_APT_TEST_REPO_TOKEN }} |