-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from raskyld/raskyld-patch-1
Start CD release pipeline
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [created] | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
args: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.ldflags.outputs.version }} | ||
steps: | ||
- id: checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
- id: ldflags | ||
run: | | ||
echo "version=$(git describe --tags --always --dirty | cut -c2-)" >> "$GITHUB_OUTPUT" | ||
build: | ||
permissions: | ||
id-token: write # To sign. | ||
contents: write # To upload release assets. | ||
actions: read # To read workflow path. | ||
needs: args | ||
strategy: | ||
matrix: | ||
os: | ||
- linux | ||
- darwin | ||
arch: | ||
- arm64 | ||
- amd64 | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
go-version: 1.21 | ||
evaluated-envs: "VERSION:${{needs.args.outputs.version}}, TARGET_OS:${{matrix.os}}, TARGET_ARCH:${{matrix.arch}}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Version for this file. | ||
version: 1 | ||
|
||
# (Optional) List of env variables used during compilation. | ||
env: | ||
- GO111MODULE=on | ||
- CGO_ENABLED=0 | ||
|
||
# The OS to compile for. `GOOS` env variable will be set to this value. | ||
goos: "{{ .Env.TARGET_OS }}" | ||
|
||
# The architecture to compile for. `GOARCH` env variable will be set to this value. | ||
goarch: "{{ .Env.TARGET_ARCH }}" | ||
|
||
# Binary output name. | ||
# {{ .Os }} will be replaced by goos field in the config file. | ||
# {{ .Arch }} will be replaced by goarch field in the config file. | ||
binary: binary-{{ .Os }}-{{ .Arch }} | ||
|
||
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow. | ||
ldflags: | ||
- "-X main.Version={{ .Env.VERSION }}" |