release: Move changelog and release creation to GitHub Actions #1
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.tag.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get tag name | |
| id: tag | |
| run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
| - name: Install git-cliff | |
| uses: kenji-miyake/setup-git-cliff@v2 | |
| - name: Generate changelog | |
| run: | | |
| git-cliff --config cliff.toml --unreleased --strip header \ | |
| --tag "${{ steps.tag.outputs.tag }}" > /tmp/release-notes.md | |
| - name: Create GitHub release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "${{ steps.tag.outputs.tag }}" \ | |
| --title "${{ steps.tag.outputs.tag }}" \ | |
| --notes-file /tmp/release-notes.md | |
| build-rpm: | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| container: fedora:43 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: dnf install -y rpm-build make gcc python3 curl git | |
| - name: Build RPM | |
| run: make rpm | |
| - name: Upload RPM to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| dnf install -y gh | |
| gh release upload "${{ needs.create-release.outputs.tag }}" \ | |
| rpmbuild/RPMS/noarch/*.rpm | |
| build-deb: | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y dpkg-dev make gcc python3 curl | |
| - name: Build DEB | |
| run: make deb | |
| - name: Upload DEB to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release upload "${{ needs.create-release.outputs.tag }}" \ | |
| *.deb |