gha: always generate release-notes in main workflow #31
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: main | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*.*.*' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Build, test and draft release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20.5' | |
- name: Run unit tests | |
run: go test -v ./... | |
- name: Install dependencies | |
run: .github/workflows/helpers/install-deps.sh | |
- name: Build web | |
run: ./web/app/make.sh all | |
- name: Build binaries | |
run: .github/workflows/helpers/build-bin.sh build/ all | |
- name: Run integration tests | |
run: .github/workflows/helpers/run-tests.sh build/notesium-linux-amd64 | |
- name: Print version | |
run: build/notesium-linux-amd64 version --verbose | |
- name: Generate release notes | |
run: .github/workflows/helpers/release-notes.sh ${{ github.ref }} > build/release-notes.md | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: build/ | |
- name: Create draft release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: ${{ github.ref_name }} | |
tag_name: ${{ github.ref_name }} | |
fail_on_unmatched_files: true | |
body_path: build/release-notes.md | |
files: | | |
build/checksums.txt | |
build/notesium-linux-amd64 | |
build/notesium-darwin-amd64 | |
build/notesium-windows-amd64.exe | |