From 06d8287f0079557d9af24faa556068cbe2b25d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommi=20M=C3=A4klin?= Date: Tue, 4 Jun 2024 10:18:43 +0000 Subject: [PATCH] Create make_release.yml --- .github/workflows/make_release.yml | 128 +++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 .github/workflows/make_release.yml diff --git a/.github/workflows/make_release.yml b/.github/workflows/make_release.yml new file mode 100644 index 0000000..efd56d9 --- /dev/null +++ b/.github/workflows/make_release.yml @@ -0,0 +1,128 @@ +name: Build binaries +on: + push: + tags: + - "v*.*.*" + branches: + - mgems-release-testing + +jobs: + build_linux-x86_64: + runs-on: ubuntu-latest + container: phusion/holy-build-box-64:3.0.2 + steps: + - name: Install wget + id: install-wget + run: yum install -y wget + + - name: Create io directory + id: mkdir-io + run: mkdir /io && cd /io + + - name: Download build script + id: dl-build-script + run: wget https://raw.githubusercontent.com/tmaklin/biobins/master/linux/mGEMS/build.sh + + - name: Compile binary in Holy Build Box container + id: compile-in-container + run: chmod +x build.sh && ./build.sh ${{ github.ref_name }} + + - name: Upload linux-x86_64 binary + if: success() + uses: actions/upload-artifact@v3 + with: + name: mGEMS-${{ github.ref_name }}-x86_64-redhat-linux + path: /io/mGEMS-${{ github.ref_name }}-x86_64-redhat-linux.tar.gz + + build_macOS-x86_64: + runs-on: ubuntu-latest + container: ghcr.io/shepherdjerred/macos-cross-compiler:latest + steps: + - name: Install wget + id: install-wget + run: apt install -y wget + + - name: Create io directory + id: mkdir-io + run: mkdir /io && cd /io + + - name: Download toolchain file + id: dl-toolchain-file + run: wget https://raw.githubusercontent.com/tmaklin/biobins/master/macOS/x86-64-toolchain.cmake && cp x86-64-toolchain.cmake /io/x86-64-toolchain.cmake && cp x86-64-toolchain.cmake /x86-64-toolchain.cmake + + - name: Download build script + id: dl-build-script + run: wget https://raw.githubusercontent.com/tmaklin/biobins/master/macOS/mGEMS/build.sh + + - name: Compile binary in macOS Cross Compiler container + id: compile-in-container + run: chmod +x build.sh && ./build.sh ${{ github.ref_name }} x86-64 + + - name: Upload macOS-x86_64 binary + if: success() + uses: actions/upload-artifact@v3 + with: + name: mGEMS-${{ github.ref_name }}-x86_64-apple-darwin22 + path: /io/mGEMS-${{ github.ref_name }}-x86_64-apple-darwin22.tar.gz + + build_macOS-arm64: + runs-on: ubuntu-latest + container: ghcr.io/shepherdjerred/macos-cross-compiler:latest + steps: + - name: Install wget + id: install-wget + run: apt install -y wget + + - name: Create io directory + id: mkdir-io + run: mkdir /io && cd /io + + - name: Download toolchain file + id: dl-toolchain-file + run: wget https://raw.githubusercontent.com/tmaklin/biobins/master/macOS/arm64-toolchain.cmake && cp arm64-toolchain.cmake /io/arm64-toolchain.cmake && cp arm64-toolchain.cmake /arm64-toolchain.cmake + + - name: Download build script + id: dl-build-script + run: wget https://raw.githubusercontent.com/tmaklin/biobins/master/macOS/mGEMS/build.sh + + - name: Compile binary in macOS Cross Compiler container + id: compile-in-container + run: chmod +x build.sh && ./build.sh ${{ github.ref_name }} arm64 + + - name: Upload macOS-arm64 binary + if: success() + uses: actions/upload-artifact@v3 + with: + name: mGEMS-${{ github.ref_name }}-arm64-apple-darwin22 + path: /io/mGEMS-${{ github.ref_name }}-arm64-apple-darwin22.tar.gz + + create-release: + runs-on: ubuntu-latest + + needs: [ build_linux-x86_64, build_macOS-x86_64, build_macOS-arm64 ] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/download-artifact@v2 + with: + path: build + + - name: Organise files + shell: bash + run: | + cp build/mGEMS-${{ github.ref_name }}-arm64-apple-darwin22/mGEMS-${{ github.ref_name }}-arm64-apple-darwin22.tar.gz . + cp build/mGEMS-${{ github.ref_name }}-x86_64-apple-darwin22/mGEMS-${{ github.ref_name }}-x86_64-apple-darwin22.tar.gz . + cp build/mGEMS-${{ github.ref_name }}-x86_64-redhat-linux/mGEMS-${{ github.ref_name }}-x86_64-redhat-linux.tar.gz . + + - name: Create release + id: create_release + uses: softprops/action-gh-release@v1 + with: + name: Release ${{ github.ref_name }} + draft: false + prerelease: false + fail_on_unmatched_files: true + generate_release_notes: true + files: | + mGEMS-*.tar.gz