Skip to content

Commit 977b13a

Browse files
committed
add option to release candidates
1 parent 396ea3e commit 977b13a

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

.github/workflows/release.yml

+38-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
commit:
1111
description: Commit to be released
1212
required: false
13+
rc:
14+
description: "release candidate"
15+
required: false
16+
default: false
17+
type: boolean
1318

1419
defaults:
1520
run:
@@ -22,6 +27,7 @@ concurrency:
2227
env:
2328
VERSION: "${{ github.event.inputs.version }}"
2429
COMMIT: "${{ github.event.inputs.commit }}"
30+
RELEASE_CANDIDATE: "${{ github.event.inputs.rc }}"
2531

2632
jobs:
2733
test:
@@ -70,22 +76,29 @@ jobs:
7076
environment: staging
7177
runs-on: ubuntu-latest
7278
needs: test
73-
env:
74-
PACKAGE_NAME: "logsmith_linux_${VERSION}.zip"
7579

7680
steps:
7781
- name: Checkout
7882
uses: actions/checkout@v3
7983
with:
8084
ref: ${{ env.COMMIT }}
8185

86+
- name: Set package name
87+
run: |
88+
if [ "${{ env.RELEASE_CANDIDATE }}" = "true" ]; then
89+
export PACKAGE_NAME="logsmith_linux_${VERSION}-rc.zip" >> $GITHUB_ENV
90+
else
91+
export PACKAGE_NAME="logsmith_linux_${VERSION}.zip" >> $GITHUB_ENV
92+
fi
93+
8294
- name: Setup Python
8395
uses: actions/setup-python@v4
8496
with:
8597
python-version: 3.11
8698

8799
- name: Setup Project
88100
run: |
101+
sudo apt-get install libxcb-cursor0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0
89102
python -m pip install --upgrade pip
90103
pip install -r requirements.txt
91104
@@ -102,10 +115,17 @@ jobs:
102115
commit=${GITHUB_SHA}
103116
fi
104117
118+
if [ "${{ env.RELEASE_CANDIDATE }}" = "true" ]; then
119+
version="${VERSION}-rc"
120+
else
121+
version="${VERSION}"
122+
fi
123+
124+
105125
pip install requests
106126
./ci/release.py \
107127
--repository "${{ github.repository }}" \
108-
--version "${{ env.VERSION }}" \
128+
--version "${version}" \
109129
--commit "${commit}" \
110130
--token "${{ secrets.GITHUB_TOKEN }}" \
111131
--asset "${{ env.PACKAGE_NAME }}"
@@ -115,15 +135,21 @@ jobs:
115135
environment: staging
116136
runs-on: macos-latest
117137
needs: test
118-
env:
119-
PACKAGE_NAME: "logsmith_darwin_${VERSION}.zip"
120138

121139
steps:
122140
- name: Checkout
123141
uses: actions/checkout@v3
124142
with:
125143
ref: ${{ env.COMMIT }}
126144

145+
- name: Set package name
146+
run: |
147+
if [ "${{ env.RELEASE_CANDIDATE }}" = "true" ]; then
148+
export PACKAGE_NAME="logsmith_darwin_${VERSION}-rc.zip" >> $GITHUB_ENV
149+
else
150+
export PACKAGE_NAME="logsmith_darwin_${VERSION}.zip" >> $GITHUB_ENV
151+
fi
152+
127153
- name: Setup Python
128154
uses: actions/setup-python@v4
129155
with:
@@ -147,10 +173,16 @@ jobs:
147173
commit=${GITHUB_SHA}
148174
fi
149175
176+
if [ "${{ env.RELEASE_CANDIDATE }}" = "true" ]; then
177+
version="${VERSION}-rc"
178+
else
179+
version="${VERSION}"
180+
fi
181+
150182
pip install requests
151183
./ci/release.py \
152184
--repository "${{ github.repository }}" \
153-
--version "${{ env.VERSION }}" \
185+
--version "${version}" \
154186
--commit "${commit}" \
155187
--token "${{ secrets.GITHUB_TOKEN }}" \
156188
--asset "${{ env.PACKAGE_NAME }}"

0 commit comments

Comments
 (0)