Skip to content

Commit

Permalink
Create release
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored Oct 22, 2023
1 parent ff62021 commit 9551b30
Showing 1 changed file with 49 additions and 14 deletions.
63 changes: 49 additions & 14 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,39 @@ on:
# TODO: probably create a nightly job

jobs:
name: Get version
get-version:
runs-on: ubuntu-latest
outputs:
QGIS_VERSION: ${{ steps.get-version.outputs.QGIS_VERSION }}
QGIS_VERSION_SHORT: ${{ steps.get-version.outputs.QGIS_VERSION_SHORT }}
MICROMAMBA_PLATFORM: ${{ steps.get-version.outputs.MICROMAMBA_PLATFORM }}
steps:
- name: 🌾 Get latest version
id: get-version
shell: bash
run: |
QGIS_VERSION=$(conda search -c conda-forge -f qgis | grep py311 | tail -n 1 | tr -s ' ' | cut -f 2 -d ' ')
QGIS_VERSION_SHORT=$(echo $QGIS_VERSION | cut -d'.' -f 1,2)
echo QGIS_VERSION=$QGIS_VERSION >> $GITHUB_OUTPUT
echo QGIS_VERSION_SHORT=$QGIS_VERSION_SHORT >> $GITHUB_OUTPUT
echo MICROMAMBA_PLATFORM=$MICROMAMBA_PLATFORM >> $GITHUB_OUTPUT
package:
name: Package for macOS
runs-on: macos-13
needs: get-version
env:
QGIS_VERSION: ${{ needs.get-version.outputs.QGIS_VERSION }}
QGIS_VERSION_SHORT: ${{ needs.get-version.outputs.QGIS_VERSION_SHORT }}
MICROMAMBA_PLATFORM: ${{ needs.get-version.outputs.MICROMAMBA_PLATFORM }}
strategy:
matrix:
include:
- architecture: 'x86_64'
conda_platform: 'osx-64'
- architecture: 'arm64'
conda_platform: 'osx-arm64'

name: Package for macOS
steps:
- name: 🐣 Checkout
uses: actions/checkout@v3
Expand All @@ -37,24 +59,18 @@ jobs:
ref: qgis-bundling
path: constructor

- name: Prepare
run: |
sed -i '' "s/__ver__/$QGIS_VERSION/g" construct.yaml
sed -i '' "s/__shortver__/$QGIS_VERSION_SHORT/g" construct.yaml
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: "constructor"
environment-file: "environment.yaml"

- name: 🌾 Get latest version
shell: bash
run: |
QGIS_VERSION=$(conda search -c conda-forge -f qgis | grep py311 | tail -n 1 | tr -s ' ' | cut -f 2 -d ' ')
QGIS_VERSION_SHORT=$(echo $QGIS_VERSION | cut -d'.' -f 1,2)
echo QGIS_VERSION=$QGIS_VERSION >> $GITHUB_ENV
echo QGIS_VERSION_SHORT=$QGIS_VERSION_SHORT >> $GITHUB_ENV
echo MICROMAMBA_PLATFORM=$MICROMAMBA_PLATFORM >> $GITHUB_ENV
sed -i '' "s/__ver__/$QGIS_VERSION/g" construct.yaml
sed -i '' "s/__shortver__/$QGIS_VERSION_SHORT/g" construct.yaml
- name: 📦 Package
shell: pwsh
run: |
Expand All @@ -73,3 +89,22 @@ jobs:
name: QGIS-${{ env.QGIS_VERSION }}-MacOSX-${{ matrix.architecture }}
path: QGIS-${{ env.QGIS_VERSION }}-MacOSX-${{ matrix.architecture }}.pkg

release:
name: Release
runs-on: macos-13
env:
QGIS_VERSION: ${{ needs.get-version.outputs.QGIS_VERSION }}
QGIS_VERSION_SHORT: ${{ needs.get-version.outputs.QGIS_VERSION_SHORT }}
MICROMAMBA_PLATFORM: ${{ needs.get-version.outputs.MICROMAMBA_PLATFORM }}
steps:
- uses: actions/download-artifact@v3
with:
name: QGIS-${{ env.QGIS_VERSION }}-MacOSX-x86_64
- uses: actions/download-artifact@v3
with:
name: QGIS-${{ env.QGIS_VERSION }}-MacOSX-arm64
- uses: ncipollo/release-action@v1
with:
name: $${{ env.QGIS_VERSION }}
artifacts: "*.pkg"
body: "body.md"

0 comments on commit 9551b30

Please sign in to comment.