-
Notifications
You must be signed in to change notification settings - Fork 0
Add GoReleaser packaging for release builds #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- name: Setup Rust | ||
uses: leynos/shared-actions/.github/actions/setup-rust@c6559452842af6a83b83429129dccaf910e34562 | ||
- name: Install cross | ||
run: cargo install cross | ||
- name: Build binaries | ||
run: | | ||
cross build --target x86_64-unknown-linux-gnu --release | ||
cross build --target x86_64-apple-darwin --release | ||
cross build --target x86_64-unknown-freebsd --release | ||
- name: Prepare dist | ||
run: | | ||
mkdir -p dist/wireframe_linux_amd64 | ||
cp target/x86_64-unknown-linux-gnu/release/wireframe dist/wireframe_linux_amd64/ | ||
mkdir -p dist/wireframe_darwin_amd64 | ||
cp target/x86_64-apple-darwin/release/wireframe dist/wireframe_darwin_amd64/ | ||
mkdir -p dist/wireframe_freebsd_amd64 | ||
cp target/x86_64-unknown-freebsd/release/wireframe dist/wireframe_freebsd_amd64/ | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21' | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha): An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. Source: opengrep Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow Medium
Unpinned 3rd party Action 'Release' step
Uses Step Error loading related location Loading |
||
with: | ||
distribution: goreleaser | ||
version: v1.24.0 | ||
Comment on lines
+35
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Remove --clean when packaging prebuilt binaries The workflow compiles and copies the release binaries into Useful? React with 👍 / 👎. |
||
args: release --clean --skip=build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
project_name: wireframe | ||
builds: | ||
- id: wireframe | ||
binary: wireframe | ||
goos: | ||
- linux | ||
- darwin | ||
- freebsd | ||
goarch: | ||
- amd64 | ||
skip: true | ||
archives: | ||
- id: wireframe-archive | ||
builds: [wireframe] | ||
format: tar.gz | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||
files: | ||
- LICENSE | ||
- README.md | ||
nfpms: | ||
- id: wireframe-nfpm | ||
builds: [wireframe] | ||
file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||
formats: [deb, rpm] | ||
maintainer: "Payton McIntosh <pmcintosh@df12.net>" | ||
description: "An experimental Rust library that simplifies building servers and clients for custom binary protocols." | ||
license: ISC | ||
homepage: https://github.com/leynos/wireframe | ||
checksum: | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Cross build step targets unsupported macOS toolchain
The job attempts to run
cross build --target x86_64-apple-darwin
. Thecross
project intentionally does not ship Docker images for Apple targets because the macOS SDK cannot be redistributed, so this command fails onubuntu-latest
runners before packaging ever runs. The release workflow will never complete successfully until the macOS build is removed or performed on a macOS runner with an appropriate toolchain.Useful? React with 👍 / 👎.