Skip to content

Commit

Permalink
Update release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMabbett authored Feb 5, 2024
1 parent 5fb0c82 commit 492b902
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
release-linux-amd64:
name: release linux/amd64
runs-on: ubuntu-latest
outputs:
binary_name: ${{ steps.build.outputs.binary_name }}
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -18,9 +20,12 @@ jobs:
go-version: '1.21'

- name: Build project
id: build
run: |
export RELEASE_TAG_NAME=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//') # Remove 'v' prefix from tag name if present
export BINARY_NAME=terrabot-${RELEASE_TAG_NAME}-linux-amd64
RELEASE_TAG_NAME=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//')
BINARY_NAME="terrabot-${RELEASE_TAG_NAME}-linux-amd64"
echo "BINARY_NAME=${BINARY_NAME}" >> $GITHUB_ENV
echo "BINARY_NAME=${BINARY_NAME}" >> $GITHUB_OUTPUT
go build -o ${BINARY_NAME} .
env:
GOOS: linux
Expand All @@ -33,5 +38,5 @@ jobs:
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ env.BINARY_NAME }}
asset_name: ${{ env.BINARY_NAME }}
asset_name: ${{ steps.build.outputs.binary_name }}
asset_content_type: application/octet-stream

0 comments on commit 492b902

Please sign in to comment.