Skip to content

Commit dc31365

Browse files
committed
feat: add get version back
1 parent 9b09020 commit dc31365

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,34 @@ name: "Nightly Builds"
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
workflow_dispatch:
99
inputs:
1010
ref:
11-
description: 'Branch or tag to build'
11+
description: "Branch or tag to build"
1212
required: true
13-
default: 'main'
13+
default: "main"
1414
type: string
1515

1616
env:
1717
CARGO_TERM_COLOR: always
1818

1919
jobs:
20+
get-version:
21+
name: Get Version
22+
runs-on: ubuntu-latest
23+
outputs:
24+
version: ${{ steps.get_version.outputs.version }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Get Version
28+
id: get_version
29+
run: echo "version=$(grep '^version = ' src/ui/Cargo.toml | cut -d '"' -f2)" >> $GITHUB_OUTPUT
30+
2031
build-linux:
32+
needs: get-version
2133
name: Build Linux
2234
runs-on: ubuntu-latest
2335
steps:
@@ -59,15 +71,15 @@ jobs:
5971
Type=Application
6072
Categories=Development;
6173
EOF
62-
74+
6375
# Copy icon
6476
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps/
6577
cp .github/scope-round-200.png AppDir/usr/share/icons/hicolor/256x256/apps/scope.png
66-
78+
6779
# Copy binary
6880
mkdir -p AppDir/usr/bin
6981
cp target/release/scope AppDir/usr/bin/
70-
82+
7183
# Create AppImage
7284
wget -O linuxdeploy-x86_64.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
7385
chmod +x linuxdeploy-x86_64.AppImage
@@ -81,6 +93,7 @@ jobs:
8193
path: Scope-${{ needs.get-version.outputs.version }}.AppImage
8294

8395
build-windows:
96+
needs: get-version
8497
name: Build Windows
8598
runs-on: windows-latest
8699
steps:
@@ -161,6 +174,7 @@ jobs:
161174
path: Scope-${{ needs.get-version.outputs.version }}.msi
162175

163176
build-macos-intel:
177+
needs: get-version
164178
name: Build macOS (Intel)
165179
runs-on: macos-latest
166180
steps:
@@ -191,7 +205,7 @@ jobs:
191205
mkdir -p Scope.app/Contents/{MacOS,Resources}
192206
cp target/x86_64-apple-darwin/release/scope Scope.app/Contents/MacOS/
193207
cp .github/scope-round-200.png Scope.app/Contents/Resources/scope.icns
194-
208+
195209
cat > Scope.app/Contents/Info.plist << EOF
196210
<?xml version="1.0" encoding="UTF-8"?>
197211
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@@ -232,6 +246,7 @@ jobs:
232246
path: Scope-${{ needs.get-version.outputs.version }}_intel.dmg
233247

234248
build-macos-silicon:
249+
needs: get-version
235250
name: Build macOS (Silicon)
236251
runs-on: macos-latest
237252
steps:
@@ -262,7 +277,7 @@ jobs:
262277
mkdir -p Scope.app/Contents/{MacOS,Resources}
263278
cp target/aarch64-apple-darwin/release/scope Scope.app/Contents/MacOS/
264279
cp .github/scope-round-200.png Scope.app/Contents/Resources/scope.icns
265-
280+
266281
cat > Scope.app/Contents/Info.plist << EOF
267282
<?xml version="1.0" encoding="UTF-8"?>
268283
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

0 commit comments

Comments
 (0)