The merge (#143) #191
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: [main, dev] | |
env: | |
BRANCH: "main" | |
RAYLIB_TAG: "4.5.0" | |
ZSTD_TAG: "v1.5.5" | |
jobs: | |
release-create: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
outputs: | |
release: ${{ steps.release.outputs.release_tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: release | |
name: Create Release | |
if: github.repository != 'EpitechPromo2026/B-CPP-500-TLS-5-1-rtype-xavier.mitault.git' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then | |
export GITHUB_OUTPUT=$GITHUB_OUTPUT | |
bash ./.github/workflows/release.sh "${{ env.BRANCH }}" | |
else | |
echo "release_tag=0.0.0" >> $GITHUB_OUTPUT | |
fi | |
release-windows: | |
runs-on: windows-latest | |
needs: [release-create, zstd-to-tar] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install winget | |
uses: Cyberboss/install-winget@v1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies | |
run: ./scripts/install-deps-windows.ps1 | |
- name: Build | |
run: ./scripts/bundle-windows.ps1 | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./r-type-windows.zip | |
gh release upload ${{ needs.release-create.outputs.release }} ./r-type-windows.exe | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: r-type-windows.zip | |
path: ./r-type-windows.zip | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: r-type-windows.exe | |
path: ./r-type-windows.exe | |
release-linux: | |
runs-on: ubuntu-latest | |
needs: [release-create, zstd-to-tar] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo ./scripts/install-deps-linux.sh | |
- name: Build | |
run: ./scripts/bundle-linux.sh | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./r-type-linux.tar.gz | |
gh release upload ${{ needs.release-create.outputs.release }} ./r-type-linux.sh | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: r-type-linux.tar.gz | |
path: ./r-type-linux.tar.gz | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: r-type-linux.sh | |
path: ./r-type-linux.sh | |
release-macos: | |
runs-on: macos-latest | |
needs: [release-create, zstd-to-tar] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: ./scripts/install-deps-macos.sh | |
- name: Build | |
run: ./scripts/bundle-macos.sh | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./r-type-macos.zip | |
gh release upload ${{ needs.release-create.outputs.release }} ./r-type-macos.dmg | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: r-type-macos.dmg | |
path: ./r-type-macos.dmg | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: r-type-macos.zip | |
path: ./r-type-macos.zip | |
zstd-to-tar: | |
runs-on: ubuntu-latest | |
needs: release-create | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install deps | |
run: sudo apt-get update && sudo apt-get install -y tar git | |
- name: Get Zstd | |
run: | | |
git clone https://github.com/facebook/zstd.git zstd-repo | |
cd zstd-repo || exit 14 | |
git checkout ${{ env.ZSTD_TAG }} | |
cd .. | |
- name: To Tar | |
run: | | |
tar -cvf zstd.tar zstd-repo | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./zstd.tar | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zstd.tar | |
path: ./zstd.tar |