From ead6573036510128a90d00ba01f09ab79b381022 Mon Sep 17 00:00:00 2001 From: rot1024 Date: Fri, 17 Jun 2022 18:37:02 +0900 Subject: [PATCH] ci: fix ci and build workflow --- .github/workflows/build.yml | 6 ++++-- .github/workflows/ci.yml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec32adeb..6dfbc955 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,13 +69,15 @@ jobs: - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: - args: release --rm-dist --snapshot + args: release --rm-dist $SNAPSHOT env: + SNAPSHOT: ${{ !needs.info.outputs.tag && '--snapshot' || '' }} GORELEASER_CURRENT_TAG: ${{ needs.info.outputs.tag || '0.0.0' }} - name: Rename artifacts + if: "!needs.info.outputs.tag" run: for f in $ARTIFACTS; do mv $f $(echo $f | sed -E 's/_0\.0\.0-SNAPSHOT-[^_]*/_${NAME}/'); done env: - NAME: ${{ needs.info.outputs.tag || needs.info.outputs.name }} + NAME: ${{ needs.info.outputs.name }} - name: Release nightly/rc if: "!needs.info.outputs.tag" uses: ncipollo/release-action@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b153b1d1..333885a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: ci: name: CI runs-on: ubuntu-latest - if: "!startsWith(github.event.head_commit.message, 'v')" + if: github.event_name !== 'push' || !startsWith(github.event.head_commit.message, 'v') services: mongo: image: mongo:4.4-focal