Don't use ANSI calls in QgisUntwine (#191) #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Draft Release | |
on: | |
push: | |
# only publish draft for x.x.x tags | |
tags: | |
# - '**' # for testing | |
- "[0-9]+.[0-9]+.[0-9]+" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Configure source tree | |
defaults: | |
run: | |
shell: bash -l {0} | |
runs-on: 'ubuntu-latest' | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mamba-org/setup-micromamba@v2 | |
with: | |
init-shell: bash | |
environment-file: "ci/environment.yml" | |
environment-name: "untwine" | |
cache-environment: true | |
cache-downloads: true | |
- name: Setup | |
shell: bash -l {0} | |
run: | | |
mkdir build | |
- name: CMake | |
shell: bash -l {0} | |
run: | | |
cmake -G "Ninja" \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DBUILD_TESTING=ON \ | |
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ | |
.. | |
working-directory: ./build | |
- name: Generate source distribution | |
shell: bash -l {0} | |
run: | | |
ninja dist | |
extensions=".tar.gz .tar.bz2" | |
for ext in $extensions | |
do | |
for filename in $(ls *$ext) | |
do | |
`md5sum $filename > $filename.md5` | |
`sha256sum $filename > $filename.sha256sum` | |
`sha512sum $filename > $filename.sha512sum` | |
done | |
done | |
working-directory: ./build | |
- uses: actions/upload-artifact@v4 | |
name: Gather source distribution artifact | |
with: | |
name: source-package-ubuntu-latest | |
if-no-files-found: error | |
path: | | |
./build/Untwine* | |
test: | |
name: Test ${{ github.ref_name }} release | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
name: Download release artifact | |
with: | |
name: source-package-ubuntu-latest | |
path: release | |
- name: Verify checksums | |
shell: bash -l {0} | |
working-directory: ./release | |
run: | | |
set -e | |
sha256sum -c *.sha256sum | |
- name: Unzip | |
shell: bash -l {0} | |
working-directory: ./release | |
run: | | |
set -e | |
echo "Tagged version is $GITHUB_REF_NAME, checking that Untwine version is the same" | |
ls * | |
tar xvf Untwine-${{ github.ref_name }}-src.tar.bz2 | |
cd Untwine-$GITHUB_REF_NAME-src | |
- uses: mamba-org/setup-micromamba@v2 | |
name: Install mamba | |
with: | |
init-shell: bash | |
environment-file: "./release/Untwine-${{ github.ref_name }}-src/ci/environment.yml" | |
environment-name: "untwine" | |
cache-environment: true | |
cache-downloads: true | |
- name: Confirm release | |
shell: bash -l {0} | |
working-directory: ./release/Untwine-${{ github.ref_name }}-src | |
run: | | |
set -e | |
mkdir build | |
cd build | |
cmake -G "Ninja" \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DBUILD_TESTING=OFF \ | |
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ | |
.. | |
ninja install | |
export UNTWINE_VERSION=$(untwine --version | sed 's/.*(\(.*\))/\1/') | |
if [ $GITHUB_REF_NAME == $UNTWINE_VERSION ]; then | |
echo "Tagged version equals tree version. All good." | |
else | |
echo "Tagged version is $GITHUB_REF_NAME and Untwine version is $Untwine_VERSION. Failing" | |
exit 1; | |
fi | |
release: | |
name: Gather and attach release | |
runs-on: ubuntu-latest | |
needs: test | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
name: Download release artifact | |
with: | |
name: source-package-ubuntu-latest | |
path: release | |
- uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
name: Publish release as draft | |
with: | |
make_latest: false | |
fail_on_unmatched_files: true | |
prerelease: true | |
generate_release_notes: true | |
draft: true | |
files: | | |
release/Untwine-* | |