-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use goreleaser for releasing and cosign for signing
- Loading branch information
Showing
12 changed files
with
106 additions
and
214 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
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
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
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 |
---|---|---|
|
@@ -12,51 +12,46 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: create release and upload binary | ||
|
||
name: Create Release and Upload Binaries | ||
# run only on tags | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
permissions: | ||
contents: write # needed to write releases | ||
id-token: write # needed for keyless signing | ||
packages: write # needed to upload artifacts | ||
env: | ||
GO_VERSION: 1.21.3 | ||
|
||
jobs: | ||
build: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: install go | ||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: 1.20.6 | ||
|
||
- name: get version | ||
id: v | ||
run: echo ::set-output name=tag::$( awk -F '/' '{print $NF}' <<< "${GITHUB_REF}" ) | ||
|
||
- name: build | ||
run: | | ||
go build ./cmd/crypki | ||
tar -czvf crypki-${{ steps.v.outputs.tag }}-linux.tar.gz --transform 's,^,crypki-${{ steps.v.outputs.tag }}-${OS}/,' crypki | ||
- name: create release | ||
id: create-release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.v.outputs.tag }} | ||
release_name: ${{ steps.v.outputs.tag }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: upload linux binary | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create-release.outputs.upload_url }} | ||
asset_path: crypki-${{ steps.v.outputs.tag }}-linux.tar.gz | ||
asset_name: crypki-${{ steps.v.outputs.tag }}-linux.tar.gz | ||
asset_content_type: application/gzip | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 # this is important, otherwise it won't checkout the full tree (i.e. no previous tags) | ||
|
||
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2 | ||
with: | ||
cosign-release: 'v2.2.0' # optional | ||
- uses: anchore/sbom-action/download-syft@78fc58e266e87a38d4194b2137a3d4e9bcaf7ca1 # v0.14.3 | ||
- uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
project_name: crypki | ||
|
||
gomod: | ||
proxy: true | ||
|
||
env: | ||
- GO111MODULE=on | ||
- COSIGN_YES=true | ||
|
||
|
||
sboms: | ||
- artifacts: binary | ||
|
||
builds: | ||
- main: ./cmd/crypki | ||
goos: | ||
- linux | ||
|
||
kos: | ||
- repository: ghcr.io/theparanoids/crypki | ||
tags: | ||
- '{{.Version}}' | ||
- latest | ||
bare: true | ||
preserve_import_paths: false | ||
platforms: | ||
- linux/amd64 | ||
- linux/arm64 | ||
|
||
signs: | ||
- cmd: cosign | ||
signature: "${artifact}.sig" | ||
certificate: "${artifact}.pem" | ||
args: | ||
- sign-blob | ||
- '--output-certificate=${certificate}' | ||
- '--output-signature=${signature}' | ||
- '${artifact}' | ||
artifacts: all | ||
output: true | ||
|
||
docker_signs: | ||
- cmd: cosign | ||
args: | ||
- 'sign' | ||
- '${artifact}' | ||
artifacts: manifests | ||
output: true | ||
|
||
release: | ||
footer: | | ||
### Thanks for all contributors! |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.