| 1 | on: |
| 2 | push: |
| 3 | tags: |
| 4 | - 'v*.*' |
| 5 | |
| 6 | name: Release |
| 7 | |
| 8 | jobs: |
| 9 | |
| 10 | build-ubuntu: |
| 11 | runs-on: ubuntu-22.04 |
| 12 | steps: |
| 13 | |
| 14 | - uses: actions/checkout@v4 |
| 15 | with: |
| 16 | fetch-depth: 0 |
| 17 | |
| 18 | - name: Dependency packages (apt) |
| 19 | run: | |
| 20 | sudo apt update |
| 21 | sudo apt -y install git python3-pip zip |
| 22 | |
| 23 | - name: Dependency packages (pip) |
| 24 | run: | |
| 25 | python3 -m pip install -U pip setuptools setuptools[core] wheel |
| 26 | python3 -m pip install setuptools_scm |
| 27 | |
| 28 | - name: Set environment variables |
| 29 | id: vars |
| 30 | run: | |
| 31 | echo "ver=$(make version)" >> $GITHUB_OUTPUT |
| 32 | |
| 33 | - name: Build dist |
| 34 | run: make dist |
| 35 | |
| 36 | - name: Upload artifacts |
| 37 | uses: actions/upload-artifact@v4 |
| 38 | with: |
| 39 | name: greaseweazle-ci-${{ steps.vars.outputs.ver }}-sdist |
| 40 | path: greaseweazle-${{ steps.vars.outputs.ver }}.zip |
| 41 | |
| 42 | build-win32: |
| 43 | runs-on: windows-2022 |
| 44 | steps: |
| 45 | |
| 46 | - uses: actions/checkout@v4 |
| 47 | with: |
| 48 | fetch-depth: 0 |
| 49 | |
| 50 | - name: Set up Python |
| 51 | uses: actions/setup-python@v5 |
| 52 | with: |
| 53 | python-version: 3.8 |
| 54 | architecture: x86 |
| 55 | |
| 56 | - name: Dependency packages (pip) |
| 57 | run: | |
| 58 | python -m pip install -U pip setuptools wheel |
| 59 | python -m pip install cx_Freeze setuptools_scm |
| 60 | |
| 61 | - name: Set environment variables |
| 62 | id: vars |
| 63 | shell: bash |
| 64 | run: | |
| 65 | echo "ver=$(make version)" >> $GITHUB_OUTPUT |
| 66 | |
| 67 | - name: Build dist |
| 68 | shell: bash |
| 69 | run: | |
| 70 | export GW=greaseweazle-${{ steps.vars.outputs.ver }} |
| 71 | make windist |
| 72 | curl -L http://softpres.org/_media/files:spsdeclib_5.1_windows.zip --output ipf.zip |
| 73 | 7z x -oipf ipf.zip |
| 74 | cp -a ipf/capsimg_binary/CAPSImg.dll $GW/ |
| 75 | rm -rf ipf ipf.zip |
| 76 | 7z a $GW-win32.zip $GW |
| 77 | |
| 78 | - name: Upload artifacts |
| 79 | uses: actions/upload-artifact@v4 |
| 80 | with: |
| 81 | name: greaseweazle-ci-${{ steps.vars.outputs.ver }}-win32 |
| 82 | path: greaseweazle-${{ steps.vars.outputs.ver }}-win32.zip |
| 83 | |
| 84 | build-win64: |
| 85 | runs-on: windows-2022 |
| 86 | steps: |
| 87 | |
| 88 | - uses: actions/checkout@v4 |
| 89 | with: |
| 90 | fetch-depth: 0 |
| 91 | |
| 92 | - name: Set up Python |
| 93 | uses: actions/setup-python@v5 |
| 94 | with: |
| 95 | python-version: 3.11 |
| 96 | architecture: x64 |
| 97 | |
| 98 | - name: Dependency packages (pip) |
| 99 | run: | |
| 100 | python -m pip install -U pip setuptools wheel |
| 101 | python -m pip install cx_Freeze setuptools_scm |
| 102 | |
| 103 | - name: Set environment variables |
| 104 | id: vars |
| 105 | shell: bash |
| 106 | run: | |
| 107 | echo "ver=$(make version)" >> $GITHUB_OUTPUT |
| 108 | |
| 109 | - name: Build dist |
| 110 | shell: bash |
| 111 | run: | |
| 112 | export GW=greaseweazle-${{ steps.vars.outputs.ver }} |
| 113 | make windist |
| 114 | curl -L http://softpres.org/_media/files:spsdeclib_5.1_windows.zip --output ipf.zip |
| 115 | 7z x -oipf ipf.zip |
| 116 | cp -a ipf/capsimg_binary/x64/CAPSImg.dll $GW/ |
| 117 | rm -rf ipf ipf.zip |
| 118 | 7z a $GW-win64.zip $GW |
| 119 | |
| 120 | - name: Upload artifacts |
| 121 | uses: actions/upload-artifact@v4 |
| 122 | with: |
| 123 | name: greaseweazle-ci-${{ steps.vars.outputs.ver }}-win64 |
| 124 | path: greaseweazle-${{ steps.vars.outputs.ver }}-win64.zip |
| 125 | |
| 126 | finalise: |
| 127 | needs: [build-ubuntu, build-win32, build-win64] |
| 128 | runs-on: ubuntu-22.04 |
| 129 | steps: |
| 130 | |
| 131 | - uses: actions/checkout@v4 |
| 132 | with: |
| 133 | fetch-depth: 0 |
| 134 | |
| 135 | - name: Dependency packages (apt) |
| 136 | run: | |
| 137 | sudo apt update |
| 138 | sudo apt -y install git python3-pip zip |
| 139 | |
| 140 | - name: Dependency packages (pip) |
| 141 | run: | |
| 142 | python3 -m pip install -U pip setuptools setuptools[core] wheel |
| 143 | python3 -m pip install setuptools_scm |
| 144 | |
| 145 | - name: Set environment variables |
| 146 | id: vars |
| 147 | run: | |
| 148 | echo "ver=$(make version)" >> $GITHUB_OUTPUT |
| 149 | |
| 150 | - name: Download artifacts |
| 151 | uses: actions/download-artifact@v4 |
| 152 | with: |
| 153 | pattern: greaseweazle-ci-${{ steps.vars.outputs.ver }}-* |
| 154 | merge-multiple: true |
| 155 | |
| 156 | - name: Create Release |
| 157 | id: create_release |
| 158 | uses: ncipollo/release-action@v1 |
| 159 | with: |
| 160 | tag: ${{ github.ref }} |
| 161 | token: ${{ secrets.GITHUB_TOKEN }} |
| 162 | name: Greaseweazle Tools ${{ steps.vars.outputs.ver }} |
| 163 | body: "[**Release Notes:**](https://github.com/keirf/greaseweazle/blob/master/RELEASE_NOTES)" |
| 164 | draft: false |
| 165 | prerelease: false |
| 166 | artifacts: "greaseweazle-${{ steps.vars.outputs.ver }}-win64.zip,greaseweazle-${{ steps.vars.outputs.ver }}-win32.zip,greaseweazle-${{ steps.vars.outputs.ver }}.zip" |
| 167 | artifactContentType: application/zip |