Skip to content

Commit a1d4be0

Browse files
authored
Merge pull request #98 from cpanato/updates
Updates
2 parents 3cfa6cf + f60bad2 commit a1d4be0

File tree

3 files changed

+30
-28
lines changed

3 files changed

+30
-28
lines changed

.github/workflows/release.yaml

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ jobs:
1919

2020
env:
2121
GO111MODULE: on
22-
COSIGN_EXPERIMENTAL: "true"
22+
COSIGN_YES: "true"
23+
24+
outputs:
25+
hashes: ${{ steps.hash.outputs.hashes }}
26+
tag_name: ${{ steps.tag.outputs.tag_name }}
2327

2428
steps:
2529
- name: Check out code onto GOPATH
@@ -33,7 +37,7 @@ jobs:
3337
- name: Install cosign
3438
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 # v3.1.1
3539

36-
- uses: ko-build/setup-ko@v0.6
40+
- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
3741
with:
3842
version: v0.14.1
3943

@@ -48,12 +52,15 @@ jobs:
4852
goflags=$(ldflags)
4953
echo "GO_FLAGS="${goflags}"" >> "$GITHUB_ENV"
5054
55+
- name: Log into ghcr.io
56+
run: echo ${{ secrets.GITHUB_TOKEN }} | ko login ghcr.io -u ${{ github.repository_owner }} --password-stdin
57+
5158
- name: Run GoReleaser
5259
id: run-goreleaser
5360
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
5461
with:
5562
version: latest
56-
args: release --rm-dist
63+
args: release --clean
5764
env:
5865
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5966
LDFLAGS: ${{ env.GO_FLAGS }}
@@ -67,32 +74,22 @@ jobs:
6774
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
6875
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
6976
77+
- name: build images
78+
run: make build-sign-release-images || true
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
7082
provenance:
71-
needs: [release]
83+
needs:
84+
- release
85+
7286
permissions:
7387
actions: read # To read the workflow path.
7488
id-token: write # To sign the provenance.
7589
contents: write # To add assets to a release.
90+
7691
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.7.0
7792
with:
7893
base64-subjects: "${{ needs.release.outputs.hashes }}"
79-
upload-assets: false # do not upload to a new release since goreleaser creates it
80-
81-
release-provenance:
82-
needs: [provenance]
83-
runs-on: ubuntu-latest
84-
permissions:
85-
actions: read # To read the workflow path.
86-
contents: write # To add assets to a release.
87-
steps:
88-
- name: Download the provenance
89-
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
90-
with:
91-
name: ${{needs.provenance.outputs.provenance-name}}
92-
93-
- name: Release Provenance
94-
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
95-
id: release-provenance
96-
with:
97-
draft: true
98-
files: ${{needs.provenance.outputs.provenance-name}}
94+
upload-assets: true # upload to a new release
95+
upload-tag-name: "${{ needs.release.outputs.tag_name }}"

.goreleaser.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ before:
88
hooks:
99
- go mod tidy
1010
- /bin/bash -c 'if [ -n "$(git --no-pager diff --exit-code go.mod go.sum)" ]; then exit 1; fi'
11-
- /bin/bash -c 'make build-sign-release-images'
1211

1312
gomod:
1413
proxy: true
1514

1615
builds:
1716
- id: binaries
18-
binary: vex-{{ .Os }}-{{ .Arch }}
17+
binary: vexctl-{{ .Os }}-{{ .Arch }}
1918
no_unique_dist_dir: true
2019
main: .
2120
flags:
@@ -74,5 +73,4 @@ snapshot:
7473
name_template: SNAPSHOT-{{ .ShortCommit }}
7574

7675
release:
77-
prerelease: allow
78-
draft: true # allow for manual edits
76+
prerelease: auto

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ ko:
6060
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
6161
--image-refs vexImagerefs github.com/openvex/vexctl
6262

63+
ko-local:
64+
# vexctl
65+
LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
66+
KO_DOCKER_REPO=ko.local ko build --bare \
67+
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
68+
--image-refs vexImagerefs github.com/openvex/vexctl
69+
6370
.PHONY: build-sign-release-images
6471
build-sign-release-images: ko
6572
GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \

0 commit comments

Comments
 (0)