Skip to content

Commit

Permalink
ci: fixed release jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvisonneau committed Mar 4, 2024
1 parent 8516b96 commit 87f505e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
7 changes: 5 additions & 2 deletions .github/prerelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ function cleanup {
}
trap cleanup EXIT

# Create some directories to avoid race errors on snap packages build
mkdir -p ${HOME}/.cache/snapcraft/{download,stage-packages}

# Build the binaries using a prerelease tag
git tag -d edge
git tag -f ${PRERELEASE_TAG}
goreleaser release \
--rm-dist \
--skip-validate \
--clean \
--skip=validate \
-f .goreleaser.pre.yml

# Delete existing assets from the edge prerelease on GitHub
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ jobs:
password: ${{ secrets.QUAY_TOKEN }}

- name: Snapcraft config
uses: samuelmeuli/action-snapcraft@v1
with:
snapcraft_token: ${{ secrets.SNAPCRAFT_TOKEN }}
uses: samuelmeuli/action-snapcraft@v2

- name: Set up Go
uses: actions/setup-go@v4
Expand All @@ -74,3 +72,4 @@ jobs:
run: make ${{ github.ref == 'refs/heads/main' && 'pre' || '' }}release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
3 changes: 1 addition & 2 deletions .goreleaser.pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ universal_binaries:

archives:
- name_template: '{{ .ProjectName }}_edge_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
rlcp: true
format_overrides:
- goos: windows
format: zip
Expand Down Expand Up @@ -191,4 +190,4 @@ checksum:
algorithm: sha512

changelog:
skip: true
disable: true
7 changes: 3 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ universal_binaries:

archives:
- name_template: '{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
rlcp: true
format_overrides:
- goos: windows
format: zip
Expand Down Expand Up @@ -69,7 +68,7 @@ brews:
homepage: *homepage
license: *license
folder: Formula
tap:
repository:
owner: mvisonneau
name: homebrew-tap
test: |
Expand All @@ -84,7 +83,7 @@ scoops:
- description: *description
homepage: *homepage
license: *license
bucket:
repository:
owner: mvisonneau
name: scoops

Expand Down Expand Up @@ -211,4 +210,4 @@ signs:
]

changelog:
skip: true
disable: true
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ build: ## Build the binaries using local GOOS

.PHONY: release
release: ## Build & release the binaries (stable)
mkdir -p ${HOME}/.cache/snapcraft/download
mkdir -p ${HOME}/.cache/snapcraft/stage-packages
git tag -d edge
goreleaser release --clean
find dist -type f -name "*.snap" -exec snapcraft upload --release stable,edge '{}' \;
Expand Down

0 comments on commit 87f505e

Please sign in to comment.