Skip to content

Commit d90148c

Browse files
committed
fix: get version on ubuntu
1 parent ebc8ea5 commit d90148c

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

.github/workflows/release.yml

+21-8
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,28 @@ env:
1212
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc
1313

1414
jobs:
15+
# windows does not run git cliff so we need to do it here
16+
extract_version:
17+
name: Extract Version
18+
runs-on: ubuntu-latest
19+
outputs:
20+
version: ${{ steps.set_version.outputs.version }}
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up git-cliff
28+
uses: kenji-miyake/setup-git-cliff@v1
29+
30+
- name: Set version name
31+
id: set_version
32+
run: echo "version=$(git cliff --bumped-version)" >> "$GITHUB_OUTPUT"
33+
1534
build_and_test:
1635
name: Build & Test for ${{ matrix.config.target }}
36+
needs: extract_version
1737
strategy:
1838
matrix:
1939
config:
@@ -57,20 +77,13 @@ jobs:
5777
env:
5878
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
5979

60-
- name: Set up git-cliff
61-
uses: kenji-miyake/setup-git-cliff@v1
62-
63-
- name: Set version name
64-
run: echo "version=$(git cliff --bumped-version)" >> "$GITHUB_ENV"
65-
6680
- name: 🛠️ Run Build
6781
run: cargo build -p pgt_cli --release --target ${{ matrix.config.target }}
6882
env:
6983
# Strip all debug symbols from the resulting binaries
7084
RUSTFLAGS: "-C strip=symbols -C codegen-units=1"
7185
# Inline the version in the CLI binary
72-
PGT_VERSION: ${{ env.version }}
73-
86+
PGT_VERSION: ${{ needs.extract_version.outputs.version }}
7487

7588
# windows is a special snowflake too, it saves binaries as .exe
7689
- name: 👦 Name the Binary

0 commit comments

Comments
 (0)