Skip to content

Commit fc7d100

Browse files
committed
Actions: Sync timestamp for release
Fixes split releases and preserves minute precision Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
1 parent f7eb0a8 commit fc7d100

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/build.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@ on:
66
workflow_dispatch:
77

88
jobs:
9+
setup:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
timestamp: ${{ steps.timestamp.outputs.timestamp }}
13+
steps:
14+
- name: Get timestamp
15+
id: timestamp
16+
run: echo "timestamp=$(date +'%Y.%m.%d.%H%M')" >> $GITHUB_OUTPUT
17+
918
unix-build:
19+
needs: setup
1020
runs-on: ${{ matrix.os }}
1121
strategy:
1222
matrix:
@@ -62,9 +72,6 @@ jobs:
6272
run: |
6373
LONG_SHA=${{ github.sha }}
6474
echo "sha=${LONG_SHA::7}" >> $GITHUB_OUTPUT
65-
- name: Get timestamp
66-
id: timestamp
67-
run: echo "timestamp=$(date +'%Y.%m.%d.%H%M')" >> $GITHUB_OUTPUT
6875
- name: Install dependencies
6976
run: deno install
7077
- name: Save SHA to textfile
@@ -115,7 +122,7 @@ jobs:
115122
if: ${{ github.event_name != 'workflow_dispatch' }}
116123
with:
117124
file: ${{ steps.folder-name.outputs.name }}.zip
118-
tag: ${{ steps.timestamp.outputs.timestamp }}-${{ steps.sha.outputs.sha }}
125+
tag: ${{ needs.setup.outputs.timestamp }}-${{ steps.sha.outputs.sha }}
119126
overwrite: true
120127
release_name: YALS-${{ steps.sha.outputs.sha }}
121128
body: |
@@ -129,6 +136,7 @@ jobs:
129136
- **Metal** - Includes both Metal and CPU support for macOS.
130137
131138
windows-build:
139+
needs: setup
132140
runs-on: ${{ matrix.os }}
133141
strategy:
134142
matrix:
@@ -192,9 +200,6 @@ jobs:
192200
- name: Get short SHA
193201
id: sha
194202
run: echo "sha=$("${{ github.sha }}".Substring(0,7))" >> $env:GITHUB_OUTPUT
195-
- name: Get timestamp
196-
id: timestamp
197-
run: echo "timestamp=$(Get-Date -Format 'yyyy.MM.dd.HHmm')" >> $env:GITHUB_OUTPUT
198203
- name: Install dependencies
199204
run: deno install
200205
- name: Save SHA to textfile
@@ -245,7 +250,7 @@ jobs:
245250
if: ${{ github.event_name != 'workflow_dispatch' }}
246251
with:
247252
file: ${{ steps.folder-name.outputs.name }}.zip
248-
tag: ${{ steps.timestamp.outputs.timestamp }}-${{ steps.sha.outputs.sha }}
253+
tag: ${{ needs.setup.outputs.timestamp }}-${{ steps.sha.outputs.sha }}
249254
overwrite: true
250255
release_name: YALS-${{ steps.sha.outputs.sha }}
251256
body: |

0 commit comments

Comments
 (0)