From 5fe99a5261b2c6e35e5cd1c84af5bd14495ff623 Mon Sep 17 00:00:00 2001 From: Jacek Kowalski Date: Wed, 30 Oct 2024 10:09:26 +0100 Subject: [PATCH] Automatically attach artifacts to version release (+ fixes) (#131) * Packaging: remove --package option when generating RPM Otherwise resulting RPM includes all the artifacts in /dist * Workflows: upgrade setup-go action to v5 due to deprecation * Workflows: automatically create GitHub release with all the artifacts * Workflows: add extra information before on.workflow_call element --- .github/workflows/go-tag.yml | 26 ++++++++++++++++++++++++++ .github/workflows/go.yml | 4 +++- Makefile | 1 - 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/go-tag.yml diff --git a/.github/workflows/go-tag.yml b/.github/workflows/go-tag.yml new file mode 100644 index 0000000..92ff05c --- /dev/null +++ b/.github/workflows/go-tag.yml @@ -0,0 +1,26 @@ +name: Tagged Go build + +on: + push: + tags: + - 'v*' + +jobs: + go: + name: Go + uses: ./.github/workflows/go.yml + + release: + name: Release + runs-on: ubuntu-latest + needs: [go] + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + files: dist/* + fail_on_unmatched_files: true + generate_release_notes: true diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 359b58f..f7b9bc9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,6 +5,8 @@ on: branches: [ master ] pull_request: branches: [ master ] + # This workflow is re-used in go-tag.yml + workflow_call: jobs: build: @@ -18,7 +20,7 @@ jobs: fetch-depth: '0' - name: Set up go version from go.mod - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' diff --git a/Makefile b/Makefile index ad40081..cb3ab35 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,6 @@ package-rpm-stayrtr: prepare --url "$(URL)" \ --architecture $(ARCH) \ --license "$(LICENSE) "\ - --package $(DIST_DIR) \ $(OUTPUT_STAYRTR)=/usr/bin/stayrtr \ package/.keep=/usr/share/stayrtr/.keep \ package/stayrtr.service=/lib/systemd/system/stayrtr.service \