|
| 1 | +name: Release Pest++ |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + branch: |
| 6 | + description: 'Branch to release from.' |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + version: |
| 10 | + description: 'Release version number.' |
| 11 | + required: true |
| 12 | + type: string |
| 13 | +env: |
| 14 | + PIXI_BETA_WARNING_OFF: true |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + name: Build ${{ matrix.os }} |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + os: [ubuntu-22.04, macos-13, macos-14, windows-2022] |
| 23 | + defaults: |
| 24 | + run: |
| 25 | + shell: bash -l {0} |
| 26 | + steps: |
| 27 | + - name: Checkout pest++ |
| 28 | + uses: actions/checkout@v5 |
| 29 | + with: |
| 30 | + repository: usgs/pestpp |
| 31 | + ref: ${{ inputs.branch }} |
| 32 | + |
| 33 | + - name: Setup pixi |
| 34 | + uses: prefix-dev/setup-pixi@v0.9.0 |
| 35 | + with: |
| 36 | + pixi-version: v0.41.4 |
| 37 | + |
| 38 | + - name: Setup windows compiler |
| 39 | + if: runner.os == 'Windows' |
| 40 | + uses: ilammy/msvc-dev-cmd@v1 |
| 41 | + |
| 42 | + - name: Set ostag |
| 43 | + id: ostag |
| 44 | + run: | |
| 45 | + if [[ $RUNNER_OS == "Linux" ]]; then |
| 46 | + ostag="linux" |
| 47 | + elif [[ $RUNNER_OS == "macOS" ]]; then |
| 48 | + if [[ ${{ matrix.os }} == "macos-13" ]]; then |
| 49 | + ostag="macintel" |
| 50 | + elif [[ ${{ matrix.os }} == "macos-14" ]]; then |
| 51 | + ostag="mac" |
| 52 | + fi |
| 53 | + elif [[ $RUNNER_OS == "Windows" ]]; then |
| 54 | + ostag="win" |
| 55 | + fi |
| 56 | + echo "ostag=$ostag" >> $GITHUB_OUTPUT |
| 57 | +
|
| 58 | + - name: Build binaries |
| 59 | + run: | |
| 60 | + pixi run configure |
| 61 | + pixi run build-release |
| 62 | +
|
| 63 | + - name: Make distribution |
| 64 | + run: | |
| 65 | + path=pestpp-${{ inputs.version }}-${{ steps.ostag.outputs.ostag }} |
| 66 | + cp -r bin $path |
| 67 | + rm -r $path/*/ || true |
| 68 | +
|
| 69 | + - name: Upload distribution |
| 70 | + uses: actions/upload-artifact@v4 |
| 71 | + with: |
| 72 | + name: pestpp-${{ inputs.version }}-${{ steps.ostag.outputs.ostag }} |
| 73 | + path: pestpp-${{ inputs.version }}-${{ steps.ostag.outputs.ostag }} |
0 commit comments