From 87f505e091d1916bced708ada38518a18e1cd6e2 Mon Sep 17 00:00:00 2001 From: Maxime VISONNEAU Date: Mon, 4 Mar 2024 15:35:54 +0100 Subject: [PATCH] ci: fixed release jobs --- .github/prerelease.sh | 7 +++++-- .github/workflows/release.yml | 5 ++--- .goreleaser.pre.yml | 3 +-- .goreleaser.yml | 7 +++---- Makefile | 2 ++ 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/prerelease.sh b/.github/prerelease.sh index 52d08209..86c09b70 100755 --- a/.github/prerelease.sh +++ b/.github/prerelease.sh @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2ce5b4a..9b68d729 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 }} diff --git a/.goreleaser.pre.yml b/.goreleaser.pre.yml index 12862782..5b5baf67 100644 --- a/.goreleaser.pre.yml +++ b/.goreleaser.pre.yml @@ -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 @@ -191,4 +190,4 @@ checksum: algorithm: sha512 changelog: - skip: true + disable: true diff --git a/.goreleaser.yml b/.goreleaser.yml index 32455fa2..8b675ed4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 @@ -69,7 +68,7 @@ brews: homepage: *homepage license: *license folder: Formula - tap: + repository: owner: mvisonneau name: homebrew-tap test: | @@ -84,7 +83,7 @@ scoops: - description: *description homepage: *homepage license: *license - bucket: + repository: owner: mvisonneau name: scoops @@ -211,4 +210,4 @@ signs: ] changelog: - skip: true + disable: true diff --git a/Makefile b/Makefile index 57fe321c..df8261ce 100644 --- a/Makefile +++ b/Makefile @@ -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 '{}' \;