Skip to content

Commit

Permalink
Automatically attach artifacts to version release (+ fixes) (#131)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jacekkow authored Oct 30, 2024
1 parent 44638b8 commit 5fe99a5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/go-tag.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
# This workflow is re-used in go-tag.yml
workflow_call:

jobs:
build:
Expand All @@ -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'

Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 5fe99a5

Please sign in to comment.