Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
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
Comment on lines +18 to +21

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. The cross project intentionally does not ship Docker images for Apple targets because the macOS SDK cannot be redistributed, so this command fails on ubuntu-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 👍 / 👎.

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
Copy link
Contributor

Choose a reason for hiding this comment

The 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 warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Release' step
Uses Step
uses 'goreleaser/goreleaser-action' with ref 'v5', not a pinned commit hash
with:
distribution: goreleaser
version: v1.24.0
Comment on lines +35 to +39

Choose a reason for hiding this comment

The 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 dist/… and then runs GoReleaser with args: release --clean --skip=build. The --clean flag deletes the entire dist directory before GoReleaser begins, but --skip=build tells GoReleaser not to rebuild the binaries. On a published release this step will consistently fail because no binaries are left for GoReleaser to archive or turn into packages (stat dist/wireframe_linux_amd64/wireframe: no such file or directory). Drop --clean or stop skipping the build so the packaging step has inputs.

Useful? React with 👍 / 👎.

args: release --clean --skip=build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .goreleaser.yml
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"
Loading