| 1 | name: ๐ข Release |
| 2 | |
| 3 | on: |
| 4 | workflow_run: |
| 5 | workflows: |
| 6 | - ๐งช Test |
| 7 | types: [completed] |
| 8 | branches: |
| 9 | - master |
| 10 | - release/** |
| 11 | |
| 12 | concurrency: |
| 13 | group: ${{ github.workflow }}-${{ github.ref_name }} |
| 14 | cancel-in-progress: true |
| 15 | |
| 16 | jobs: |
| 17 | release-plan: |
| 18 | name: ๐ค Plan release |
| 19 | runs-on: ubuntu-latest |
| 20 | if: github.event.workflow_run.conclusion == 'success' |
| 21 | outputs: |
| 22 | release: ${{ steps.plan_release.outputs.release }} |
| 23 | version: ${{ steps.plan_release.outputs.version }} |
| 24 | tag: ${{ steps.plan_release.outputs.tag }} |
| 25 | steps: |
| 26 | - uses: actions/checkout@v6 |
| 27 | - name: Setup Node.js |
| 28 | uses: actions/setup-node@v6 |
| 29 | with: |
| 30 | node-version: latest |
| 31 | - name: Install semantic-release |
| 32 | run: | |
| 33 | npm i semantic-release/changelog |
| 34 | - name: Plan release |
| 35 | id: plan_release |
| 36 | env: |
| 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 38 | run: | |
| 39 | npx semantic-release --dry-run | tee semantic-release.log |
| 40 | version=$(awk '/The next release version is/ { print $NF }' semantic-release.log | tail -n1) |
| 41 | if [[ -z "$version" ]]; then |
| 42 | echo "release=False" >> "$GITHUB_OUTPUT" |
| 43 | else |
| 44 | echo "release=True" >> "$GITHUB_OUTPUT" |
| 45 | printf 'version=%s\ntag=v%s\n' "$version" "$version" >> "$GITHUB_OUTPUT" |
| 46 | fi |
| 47 | |
| 48 | linux-build: |
| 49 | name: ๐ง linux build |
| 50 | runs-on: ubuntu-latest |
| 51 | needs: [release-plan] |
| 52 | if: ${{ needs.release-plan.outputs.release == 'True' }} |
| 53 | steps: |
| 54 | - uses: actions/checkout@v6 |
| 55 | - name: apt install deps |
| 56 | run: | |
| 57 | sudo apt-get update -y -q |
| 58 | sudo apt-get install -y -q --no-install-recommends cmake ninja-build libopencv-dev libgavl-dev libfreetype-dev libcairo2-dev |
| 59 | - name: Build using cmake+ninja |
| 60 | run: | |
| 61 | mkdir build && cd build |
| 62 | cmake -G "Ninja" -D FREI0R_VERSION=${{ needs.release-plan.outputs.version }} ../ |
| 63 | ninja |
| 64 | - name: Upload linux filter |
| 65 | uses: actions/upload-artifact@v6 |
| 66 | with: |
| 67 | name: release-linux-filter |
| 68 | path: build/src/filter/**/*.so |
| 69 | - name: Upload linux mixer2 |
| 70 | uses: actions/upload-artifact@v6 |
| 71 | with: |
| 72 | name: release-linux-mixer2 |
| 73 | path: build/src/mixer2/**/*.so |
| 74 | - name: Upload linux mixer3 |
| 75 | uses: actions/upload-artifact@v6 |
| 76 | with: |
| 77 | name: release-linux-mixer3 |
| 78 | path: build/src/mixer3/**/*.so |
| 79 | - name: Upload linux generator |
| 80 | uses: actions/upload-artifact@v6 |
| 81 | with: |
| 82 | name: release-linux-generator |
| 83 | path: build/src/generator/**/*.so |
| 84 | - name: Upload linux pkg-config |
| 85 | uses: actions/upload-artifact@v6 |
| 86 | with: |
| 87 | name: release-linux-pkgconfig |
| 88 | path: build/frei0r.pc |
| 89 | |
| 90 | win-build: |
| 91 | name: ๐ช win64 build |
| 92 | runs-on: windows-latest |
| 93 | needs: [release-plan] |
| 94 | if: ${{ needs.release-plan.outputs.release == 'True' }} |
| 95 | steps: |
| 96 | - uses: actions/checkout@v6 |
| 97 | - uses: ilammy/msvc-dev-cmd@v1 |
| 98 | - name: choco install deps |
| 99 | uses: crazy-max/ghaction-chocolatey@v3 |
| 100 | with: |
| 101 | args: install libopencv-dev |
| 102 | - name: Build using nmake |
| 103 | run: | |
| 104 | mkdir build && cd build |
| 105 | cmake -G "NMake Makefiles" -D BUILD_TESTING=OFF -D WITHOUT_OPENCV=1 -D WITHOUT_CAIRO=1 -D WITHOUT_GAVL=1 -D FREI0R_VERSION=${{ needs.release-plan.outputs.version }} ../ |
| 106 | nmake |
| 107 | - name: Upload win64 filter |
| 108 | uses: actions/upload-artifact@v6 |
| 109 | with: |
| 110 | name: release-win64-filter |
| 111 | path: build/src/filter/**/*.dll |
| 112 | - name: Upload win64 mixer2 |
| 113 | uses: actions/upload-artifact@v6 |
| 114 | with: |
| 115 | name: release-win64-mixer2 |
| 116 | path: build/src/mixer2/**/*.dll |
| 117 | - name: Upload win64 mixer3 |
| 118 | uses: actions/upload-artifact@v6 |
| 119 | with: |
| 120 | name: release-win64-mixer3 |
| 121 | path: build/src/mixer3/**/*.dll |
| 122 | - name: Upload win64 generator |
| 123 | uses: actions/upload-artifact@v6 |
| 124 | with: |
| 125 | name: release-win64-generator |
| 126 | path: build/src/generator/**/*.dll |
| 127 | - name: Upload win64 pkg-config |
| 128 | uses: actions/upload-artifact@v6 |
| 129 | with: |
| 130 | name: release-win64-pkgconfig |
| 131 | path: build/frei0r.pc |
| 132 | |
| 133 | osx-build: |
| 134 | name: ๐ osx build |
| 135 | runs-on: macos-latest |
| 136 | needs: [release-plan] |
| 137 | if: ${{ needs.release-plan.outputs.release == 'True' }} |
| 138 | steps: |
| 139 | - uses: actions/checkout@v6 |
| 140 | - name: Update Homebrew |
| 141 | run: | |
| 142 | brew update |
| 143 | - name: Install Homebrew dependencies |
| 144 | run: | |
| 145 | env HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 \ |
| 146 | brew install ninja cairo |
| 147 | - name: Build using ninja |
| 148 | run: | |
| 149 | mkdir build && cd build |
| 150 | cmake -G "Ninja" -D WITHOUT_OPENCV=1 -D WITHOUT_GAVL=1 -D FREI0R_VERSION=${{ needs.release-plan.outputs.version }} ../ |
| 151 | ninja |
| 152 | - name: Upload osx filter |
| 153 | uses: actions/upload-artifact@v6 |
| 154 | with: |
| 155 | name: release-osx-filter |
| 156 | path: build/src/filter/**/*.so |
| 157 | - name: Upload osx mixer2 |
| 158 | uses: actions/upload-artifact@v6 |
| 159 | with: |
| 160 | name: release-osx-mixer2 |
| 161 | path: build/src/mixer2/**/*.so |
| 162 | - name: Upload osx mixer3 |
| 163 | uses: actions/upload-artifact@v6 |
| 164 | with: |
| 165 | name: release-osx-mixer3 |
| 166 | path: build/src/mixer3/**/*.so |
| 167 | - name: Upload osx generator |
| 168 | uses: actions/upload-artifact@v6 |
| 169 | with: |
| 170 | name: release-osx-generator |
| 171 | path: build/src/generator/**/*.so |
| 172 | - name: Upload osx pkg-config |
| 173 | uses: actions/upload-artifact@v6 |
| 174 | with: |
| 175 | name: release-osx-pkgconfig |
| 176 | path: build/frei0r.pc |
| 177 | |
| 178 | publish-release: |
| 179 | name: ๐ Publish release |
| 180 | runs-on: ubuntu-latest |
| 181 | needs: [release-plan, win-build, osx-build, linux-build] |
| 182 | if: ${{ needs.release-plan.outputs.release == 'True' }} |
| 183 | outputs: |
| 184 | version: ${{ steps.publish_release.outputs.version }} |
| 185 | tag: ${{ steps.publish_release.outputs.tag }} |
| 186 | steps: |
| 187 | - uses: actions/checkout@v6 |
| 188 | - name: Setup Node.js |
| 189 | uses: actions/setup-node@v6 |
| 190 | with: |
| 191 | node-version: latest |
| 192 | - name: Install semantic-release |
| 193 | run: | |
| 194 | npm i semantic-release/changelog |
| 195 | - name: Publish release |
| 196 | id: publish_release |
| 197 | env: |
| 198 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 199 | run: | |
| 200 | npx semantic-release |
| 201 | printf 'version=%s\ntag=%s\n' \ |
| 202 | "${{ needs.release-plan.outputs.version }}" \ |
| 203 | "${{ needs.release-plan.outputs.tag }}" >> "$GITHUB_OUTPUT" |
| 204 | |
| 205 | draft-binary-release: |
| 206 | name: ๐ฆ Pack release |
| 207 | needs: [release-plan, publish-release, win-build, osx-build, linux-build] |
| 208 | if: ${{ needs.release-plan.outputs.release == 'True' }} |
| 209 | runs-on: ubuntu-latest |
| 210 | steps: |
| 211 | - uses: actions/checkout@v6 |
| 212 | - name: download binary artifacts |
| 213 | uses: actions/download-artifact@v7 |
| 214 | with: |
| 215 | path: | |
| 216 | frei0r-bin |
| 217 | - name: create compressed archives |
| 218 | run: | |
| 219 | dst=frei0r-${{ needs.publish-release.outputs.version }}_win64 |
| 220 | mkdir -p $dst/filter $dst/generator $dst/mixer2 $dst/mixer3 |
| 221 | find frei0r-bin/release-win64-filter -type f -name '*.dll' -exec cp {} $dst/filter \; |
| 222 | find frei0r-bin/release-win64-generator -type f -name '*.dll' -exec cp {} $dst/generator \; |
| 223 | find frei0r-bin/release-win64-mixer2 -type f -name '*.dll' -exec cp {} $dst/mixer2 \; |
| 224 | find frei0r-bin/release-win64-mixer3 -type f -name '*.dll' -exec cp {} $dst/mixer3 \; |
| 225 | cp README.md $dst/README.txt |
| 226 | cp COPYING $dst/LICENSE.txt |
| 227 | cp ChangeLog $dst/ChangeLog.txt |
| 228 | cp AUTHORS.md $dst/AUTHORS.txt |
| 229 | cp include/frei0r.h include/frei0r.hpp $dst/ |
| 230 | cp frei0r-bin/release-win64-pkgconfig/frei0r.pc $dst/ |
| 231 | echo "${{ needs.publish-release.outputs.version }}" > $dst/VERSION.txt |
| 232 | zip -r -9 $dst.zip $dst |
| 233 | |
| 234 | dst=frei0r-${{ needs.publish-release.outputs.version }}_osx |
| 235 | mkdir -p $dst/filter $dst/generator $dst/mixer2 $dst/mixer3 |
| 236 | find frei0r-bin/release-osx-filter -type f -name '*.so' -exec cp {} $dst/filter \; |
| 237 | find frei0r-bin/release-osx-generator -type f -name '*.so' -exec cp {} $dst/generator \; |
| 238 | find frei0r-bin/release-osx-mixer2 -type f -name '*.so' -exec cp {} $dst/mixer2 \; |
| 239 | find frei0r-bin/release-osx-mixer3 -type f -name '*.so' -exec cp {} $dst/mixer3 \; |
| 240 | cp README.md $dst/README.txt |
| 241 | cp COPYING $dst/LICENSE.txt |
| 242 | cp ChangeLog $dst/ChangeLog.txt |
| 243 | cp AUTHORS.md $dst/AUTHORS.txt |
| 244 | cp include/frei0r.h include/frei0r.hpp $dst/ |
| 245 | cp frei0r-bin/release-osx-pkgconfig/frei0r.pc $dst/ |
| 246 | echo "${{ needs.publish-release.outputs.version }}" > $dst/VERSION.txt |
| 247 | zip -r -9 $dst.zip $dst |
| 248 | |
| 249 | dst=frei0r-${{ needs.publish-release.outputs.version }}_linux |
| 250 | mkdir -p $dst/filter $dst/generator $dst/mixer2 $dst/mixer3 |
| 251 | find frei0r-bin/release-linux-filter -type f -name '*.so' -exec cp {} $dst/filter \; |
| 252 | find frei0r-bin/release-linux-generator -type f -name '*.so' -exec cp {} $dst/generator \; |
| 253 | find frei0r-bin/release-linux-mixer2 -type f -name '*.so' -exec cp {} $dst/mixer2 \; |
| 254 | find frei0r-bin/release-linux-mixer3 -type f -name '*.so' -exec cp {} $dst/mixer3 \; |
| 255 | cp README.md $dst/README.txt |
| 256 | cp COPYING $dst/LICENSE.txt |
| 257 | cp ChangeLog $dst/ChangeLog.txt |
| 258 | cp AUTHORS.md $dst/AUTHORS.txt |
| 259 | cp include/frei0r.h include/frei0r.hpp $dst/ |
| 260 | cp frei0r-bin/release-linux-pkgconfig/frei0r.pc $dst/ |
| 261 | echo "${{ needs.publish-release.outputs.version }}" > $dst/VERSION.txt |
| 262 | tar cvfz $dst.tar.gz $dst |
| 263 | |
| 264 | sha256sum *.zip *.tar.gz > SHA256SUMS.txt |
| 265 | |
| 266 | - name: release all archives |
| 267 | uses: softprops/action-gh-release@v2 |
| 268 | with: |
| 269 | files: | |
| 270 | *.zip |
| 271 | *.tar.gz |
| 272 | SHA256SUMS.txt |
| 273 | tag_name: ${{ needs.publish-release.outputs.tag }} |
| 274 | draft: true |
| 275 | prerelease: false |
| 276 | fail_on_unmatched_files: true |
| 277 | generate_release_notes: true |