Skip to content

Commit 30fbab2

Browse files
committed
Add current app-version
env variable
1 parent de3e7a3 commit 30fbab2

File tree

1 file changed

+11
-53
lines changed

1 file changed

+11
-53
lines changed

.github/workflows/pr-build.yml

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,45 @@ on:
44
pull_request:
55
branches: ["main"]
66

7-
env:
8-
APP_VERSION: "" # Define a default value for global accessibility
9-
107
jobs:
118
check-version:
129
runs-on: ubuntu-latest
1310
outputs:
11+
app-version: ${{ steps.check-version.outputs.app-version }}
1412
should-run: ${{ steps.check-version.outputs.should-run }}
1513

1614
steps:
1715
- uses: actions/checkout@v3
1816
with:
19-
fetch-depth: 0 # Fetches all history for all branches and tags
17+
fetch-depth: 0
2018

2119
- name: Get latest release version
2220
id: latest-version
2321
run: |
2422
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
2523
echo "Latest tag is $LATEST_TAG"
26-
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
24+
echo "::set-output name=latest-tag::$LATEST_TAG"
2725
2826
- name: Check version in ver.py
2927
id: check-version
3028
run: |
3129
CURRENT_VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'")
3230
echo "Current version is $CURRENT_VERSION"
3331
34-
if [ "$CURRENT_VERSION" == "$LATEST_TAG" ]; then
32+
if [ "$CURRENT_VERSION" == "${{ steps.latest-version.outputs.latest-tag }}" ]; then
3533
echo "Version $CURRENT_VERSION has not been incremented vs already released $LATEST_TAG. Build will be cancelled."
3634
echo "::set-output name=should-run::false"
3735
exit 1
3836
else
3937
echo "Current version $CURRENT_VERSION differs from latest tag $LATEST_TAG. Build will continue."
4038
echo "::set-output name=should-run::true"
41-
echo "APP_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
39+
echo "::set-output name=app-version::$CURRENT_VERSION"
4240
fi
4341
4442
build:
4543
needs: check-version
4644
if: needs.check-version.outputs.should-run == 'true'
47-
45+
runs-on: ${{ matrix.os }}
4846
strategy:
4947
matrix:
5048
include:
@@ -60,24 +58,6 @@ jobs:
6058
name: EdgeNodeLauncher-LINUX_Ubuntu-24.04
6159
platformDependencies: sudo apt-get update && sudo apt install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev --fix-missing
6260

63-
- os: ubuntu-22.04
64-
build: |
65-
chmod +x build_scripts/unix_build.sh
66-
./build_scripts/unix_build.sh
67-
name: EdgeNodeLauncher-LINUX_Ubuntu-22.04
68-
platformDependencies: sudo apt-get update && sudo apt install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev --fix-missing
69-
70-
- os: ubuntu-20.04
71-
build: |
72-
chmod +x build_scripts/unix_build.sh
73-
./build_scripts/unix_build.sh
74-
name: EdgeNodeLauncher-LINUX_Ubuntu-20.04
75-
platformDependencies: sudo apt-get update && sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev --fix-missing
76-
77-
name: Build installers ${{ matrix.os }}
78-
runs-on: ${{ matrix.os }}
79-
permissions: write-all
80-
8161
steps:
8262
- uses: actions/checkout@v3
8363
- name: Set up Python 3.10.11
@@ -90,14 +70,6 @@ jobs:
9070
pip install -r requirements.txt
9171
pip3 install --upgrade PyInstaller pyinstaller-hooks-contrib
9272
93-
- name: Replace placeholder in const.py (Windows)
94-
if: runner.os == 'Windows'
95-
env:
96-
MQTT_K: ${{ secrets.MQTT_K }}
97-
run: |
98-
$filePath = "utils/const.py"
99-
(Get-Content $filePath) -replace '\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*', "${{ env.MQTT_K }}" | Set-Content $filePath
100-
10173
- name: Replace placeholder in const.py (Linux)
10274
if: runner.os == 'Linux'
10375
env:
@@ -111,35 +83,21 @@ jobs:
11183
- name: Save build artifacts
11284
uses: actions/upload-artifact@v3
11385
with:
114-
name: ${{ matrix.name }}-build-${{ env.APP_VERSION }}-${{ github.event.pull_request.number }}-${{ github.sha }}
86+
name: ${{ matrix.name }}-build-${{ needs.check-version.outputs.app-version }}-${{ github.event.pull_request.number }}-${{ github.sha }}
11587
path: dist/*
11688

11789
collect-artifacts:
11890
needs: build
11991
runs-on: ubuntu-latest
120-
permissions: write-all
121-
12292
steps:
123-
- name: Download build artifacts
93+
- name: Download build artifacts (WIN32)
12494
uses: actions/download-artifact@v3
12595
with:
126-
name: EdgeNodeLauncher-${{ env.APP_VERSION }}-WIN32-build-${{ github.event.pull_request.number }}-${{ github.sha }}
96+
name: EdgeNodeLauncher-WIN32-build-${{ needs.check-version.outputs.app-version }}-${{ github.event.pull_request.number }}-${{ github.sha }}
12797
path: ./all-builds/EdgeNodeLauncher-WIN32
12898

129-
- name: Download build artifacts
99+
- name: Download build artifacts (Ubuntu 24.04)
130100
uses: actions/download-artifact@v3
131101
with:
132-
name: EdgeNodeLauncher-${{ env.APP_VERSION }}-LINUX_Ubuntu-24.04-build-${{ github.event.pull_request.number }}-${{ github.sha }}
102+
name: EdgeNodeLauncher-LINUX_Ubuntu-24.04-build-${{ needs.check-version.outputs.app-version }}-${{ github.event.pull_request.number }}-${{ github.sha }}
133103
path: ./all-builds/EdgeNodeLauncher-LINUX_Ubuntu-24.04
134-
135-
- name: Download build artifacts
136-
uses: actions/download-artifact@v3
137-
with:
138-
name: EdgeNodeLauncher-${{ env.APP_VERSION }}-LINUX_Ubuntu-22.04-build-${{ github.event.pull_request.number }}-${{ github.sha }}
139-
path: ./all-builds/EdgeNodeLauncher-LINUX_Ubuntu-22.04
140-
141-
- name: Download build artifacts
142-
uses: actions/download-artifact@v3
143-
with:
144-
name: EdgeNodeLauncher-${{ env.APP_VERSION }}-LINUX_Ubuntu-20.04-build-${{ github.event.pull_request.number }}-${{ github.sha }}
145-
path: ./all-builds/EdgeNodeLauncher-LINUX_Ubuntu-20.04

0 commit comments

Comments
 (0)