From 91e4b43a3dc82b8b02cbc57c05a3dc7e7a223b87 Mon Sep 17 00:00:00 2001 From: Matjaz Debelak Date: Wed, 13 Mar 2024 11:13:43 +0100 Subject: [PATCH] CI CRAP --- .github/workflows/publish.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 27749eff..f29276e4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,8 +8,22 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + token: ${{ secrets.PAT }} + - name: Bump version + run: | + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + git config user.name "$GITHUB_ACTOR" + echo $(awk -F. '{OFS="."; $NF++; print}' VERSION) > VERSION + VERSION=$(cat VERSION) + git add VERSION + git commit -m "Bump version to $VERSION" + git tag $VERSION + git push --follow-tags + git push --tags publish: + needs: version runs-on: ubuntu-latest permissions: contents: write @@ -21,27 +35,17 @@ jobs: - uses: actions/setup-go@v4 with: go-version: 1.21 - - name: Bump version - run: | - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git config user.name "$GITHUB_ACTOR" - echo $(awk -F. '{OFS="."; $NF++; print}' VERSION) > VERSION - VERSION=$(cat VERSION) - git add VERSION - git commit -m "Bump version to $VERSION" - git tag $VERSION - echo "TAG_NAME=$VERSION" >> $GITHUB_ENV - git push --follow-tags - git push --tags - name: Get OS and arch info run: | GOOSARCH=${{matrix.goosarch}} GOOS=${GOOSARCH%/*} GOARCH=${GOOSARCH#*/} BINARY_NAME=${{github.repository}}-worker-$GOOS-$GOARCH + VERSION=$(cat VERSION) echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV echo "GOOS=$GOOS" >> $GITHUB_ENV echo "GOARCH=$GOARCH" >> $GITHUB_ENV + echo "TAG_NAME=$VERSION" >> $GITHUB_ENV - name: Build run: | go build -o "$BINARY_NAME" -ldflags="-X 'main.Version=$TAG_NAME'" -v ./cmd/worker