Skip to content

Commit

Permalink
CI CRAP
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerX committed Mar 13, 2024
1 parent 59b6661 commit 91e4b43
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
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
Expand All @@ -21,27 +35,17 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Bump version
run: |
git config user.email "[email protected]"
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
Expand Down

0 comments on commit 91e4b43

Please sign in to comment.