Skip to content

Commit 7c69175

Browse files
authored
ci: use strict semver for builds + always run pip install on tests
1 parent ec13e07 commit 7c69175

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Release
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- '*'
77

88
workflow_dispatch:
99
inputs:
@@ -35,7 +35,6 @@ jobs:
3535
outputs:
3636
should_deploy: ${{ steps.buildvars.outputs.should_deploy }}
3737
pkg_version: ${{ steps.buildvars.outputs.pkg_version }}
38-
pkg_version_strict: ${{ steps.buildvars.outputs.pkg_version_strict }}
3938

4039
steps:
4140
- uses: actions/checkout@v2
@@ -57,10 +56,8 @@ jobs:
5756

5857
- name: Set Next Version Env Var
5958
if: ${{ github.event.inputs.publish == 'true' || github.event.inputs.dryrun == 'true' }}
60-
env:
61-
NEXT_VERSION: ${{ steps.semver.outputs.next }}
6259
run: |
63-
echo "NEXT_VERSION=$next" >> $GITHUB_ENV
60+
echo "NEXT_VERSION=$nextStrict" >> $GITHUB_ENV
6461
6562
- name: Create Draft Release
6663
uses: ncipollo/release-action@v1
@@ -81,19 +78,16 @@ jobs:
8178
echo "Using AUTO SEMVER mode: $NEXT_VERSION"
8279
echo "::set-output name=should_deploy::true"
8380
echo "::set-output name=pkg_version::$NEXT_VERSION"
84-
echo "::set-output name=pkg_version_strict::${NEXT_VERSION#?}"
8581
echo "::notice::Release $NEXT_VERSION created using branch $GITHUB_REF_NAME"
86-
elif [[ "$GITHUB_REF" =~ ^refs/tags/v* ]]; then
82+
elif [[ "$GITHUB_REF" =~ ^refs/tags/* ]]; then
8783
echo "Using TAG mode: $GITHUB_REF_NAME"
8884
echo "::set-output name=should_deploy::true"
8985
echo "::set-output name=pkg_version::$GITHUB_REF_NAME"
90-
echo "::set-output name=pkg_version_strict::${GITHUB_REF_NAME#?}"
9186
echo "::notice::Release $GITHUB_REF_NAME created using tag $GITHUB_REF_NAME"
9287
else
93-
echo "Using TEST mode: v8.0.0-dev.$GITHUB_RUN_NUMBER"
88+
echo "Using TEST mode: 8.0.0-dev.$GITHUB_RUN_NUMBER"
9489
echo "::set-output name=should_deploy::false"
95-
echo "::set-output name=pkg_version::v8.0.0-dev.$GITHUB_RUN_NUMBER"
96-
echo "::set-output name=pkg_version_strict::8.0.0-dev.$GITHUB_RUN_NUMBER"
90+
echo "::set-output name=pkg_version::8.0.0-dev.$GITHUB_RUN_NUMBER"
9791
echo "::notice::Non-production build 8.0.0-dev.$GITHUB_RUN_NUMBER created using branch $GITHUB_REF_NAME"
9892
fi
9993
@@ -166,7 +160,6 @@ jobs:
166160
env:
167161
SHOULD_DEPLOY: ${{needs.prepare.outputs.should_deploy}}
168162
PKG_VERSION: ${{needs.prepare.outputs.pkg_version}}
169-
PKG_VERSION_STRICT: ${{needs.prepare.outputs.pkg_version_strict}}
170163

171164
steps:
172165
- uses: actions/checkout@v2
@@ -194,14 +187,13 @@ jobs:
194187
DEBIAN_FRONTEND: noninteractive
195188
run: |
196189
echo "PKG_VERSION: $PKG_VERSION"
197-
echo "PKG_VERSION_STRICT: $PKG_VERSION_STRICT"
198190
echo "GITHUB_SHA: $GITHUB_SHA"
199191
echo "GITHUB_REF_NAME: $GITHUB_REF_NAME"
200192
echo "Running build script..."
201193
chmod +x ./dev/deploy/build.sh
202194
sh ./dev/deploy/build.sh
203-
echo "Setting version $PKG_VERSION_STRICT..."
204-
sed -i -r -e "s|^__version__ += '.*'$|__version__ = '$PKG_VERSION_STRICT'|" ietf/__init__.py
195+
echo "Setting version $PKG_VERSION..."
196+
sed -i -r -e "s|^__version__ += '.*'$|__version__ = '$PKG_VERSION'|" ietf/__init__.py
205197
sed -i -r -e "s|^__release_hash__ += '.*'$|__release_hash__ = '$GITHUB_SHA'|" ietf/__init__.py
206198
sed -i -r -e "s|^__release_branch__ += '.*'$|__release_branch__ = '$GITHUB_REF_NAME'|" ietf/__init__.py
207199

dev/tests/prepare.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ echo "Fixing permissions..."
66
chmod -R 777 ./
77
echo "Copying config files..."
88
cp ./docker/configs/settings_local.py ./ietf/settings_local.py
9+
echo "Ensure all requirements.txt packages are installed..."
10+
pip install -r requirements.txt
911
echo "Installing NPM packages..."
1012
npm install --prefer-offline --no-audit
1113
echo "Building static assets..."

0 commit comments

Comments
 (0)