Skip to content

Commit

Permalink
Get timestamp in separate job to ensure it is the same across all bins
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillezi authored Sep 12, 2024
1 parent f71fef3 commit 566878e
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,30 @@ on:
paths-ignore:
- README.md
- .gitignore
- .github/**
#- .github/**
- LICENSE

jobs:
gettime:
runs-on: ubuntu-latest
outputs:
timestamp: ${{ env.TIMESTAMP }}
steps:
- name: Get current timestamp
id: timestamp
run: echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV

build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, windows, darwin]
go-version: ["1.23.1"]
outputs:
timestamp: ${{ env.TIMESTAMP }}
env:
TIMESTAMP: ${{ needs.gettime.outputs.timestamp }}
steps:
- uses: actions/checkout@v4

- name: Get current timestamp
id: timestamp
run: echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV

- name: Set up Go
uses: actions/setup-go@v4
with:
Expand Down Expand Up @@ -53,7 +58,7 @@ jobs:
needs: build
runs-on: ubuntu-latest
env:
TIMESTAMP: ${{ needs.build.outputs.timestamp }}
TIMESTAMP: ${{ needs.gettime.outputs.timestamp }}
outputs:
upload_url: ${{ steps.step_upload_url.outputs.upload_url }}
steps:
Expand Down

0 comments on commit 566878e

Please sign in to comment.