|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, dev] |
| 6 | + |
| 7 | +env: |
| 8 | + BRANCH: "main" |
| 9 | + |
| 10 | +jobs: |
| 11 | + release-create: |
| 12 | + permissions: write-all |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + outputs: |
| 16 | + release: ${{ steps.release.outputs.release_tag }} |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + |
| 24 | + - id: release |
| 25 | + name: Create Release |
| 26 | + env: |
| 27 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + run: | |
| 29 | + if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then |
| 30 | + export GITHUB_OUTPUT=$GITHUB_OUTPUT |
| 31 | + bash ./.github/workflows/release.sh "${{ env.BRANCH }}" |
| 32 | + else |
| 33 | + echo "release_tag=0.0.0" >> $GITHUB_OUTPUT |
| 34 | + fi |
| 35 | +
|
| 36 | + release-windows: |
| 37 | + runs-on: windows-latest |
| 38 | + needs: [release-create] |
| 39 | + permissions: |
| 40 | + contents: write |
| 41 | + |
| 42 | + steps: |
| 43 | + - name: Checkout |
| 44 | + uses: actions/checkout@v4 |
| 45 | + |
| 46 | + - name: Install winget |
| 47 | + uses: Cyberboss/install-winget@v1 |
| 48 | + with: |
| 49 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + |
| 51 | + - name: Install dependencies |
| 52 | + run: ./scripts/install-deps-windows.ps1 |
| 53 | + |
| 54 | + - name: Build |
| 55 | + run: ./scripts/bundle-windows.ps1 |
| 56 | + |
| 57 | + - name: Upload To Release |
| 58 | + if: github.ref == 'refs/heads/main' |
| 59 | + env: |
| 60 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + run: | |
| 62 | + gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-windows.zip |
| 63 | + gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-windows.exe |
| 64 | +
|
| 65 | + - name: Upload To Artifact |
| 66 | + if: github.ref != 'refs/heads/main' |
| 67 | + uses: actions/upload-artifact@v3 |
| 68 | + with: |
| 69 | + name: fbttf-windows.zip |
| 70 | + path: ./fbttf-windows.zip |
| 71 | + |
| 72 | + - name: Upload To Artifact |
| 73 | + if: github.ref != 'refs/heads/main' |
| 74 | + uses: actions/upload-artifact@v3 |
| 75 | + with: |
| 76 | + name: fbttf-windows.exe |
| 77 | + path: ./fbttf-windows.exe |
| 78 | + |
| 79 | + release-linux: |
| 80 | + runs-on: ubuntu-latest |
| 81 | + needs: [release-create] |
| 82 | + permissions: |
| 83 | + contents: write |
| 84 | + |
| 85 | + steps: |
| 86 | + - name: Checkout |
| 87 | + uses: actions/checkout@v4 |
| 88 | + |
| 89 | + - name: Install dependencies |
| 90 | + run: sudo bash ./scripts/install-deps-linux.sh |
| 91 | + |
| 92 | + - name: Build |
| 93 | + run: bash ./scripts/bundle-linux.sh |
| 94 | + |
| 95 | + - name: Upload To Release |
| 96 | + if: github.ref == 'refs/heads/main' |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + run: | |
| 100 | + gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-linux.tar.gz |
| 101 | + gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-linux.sh |
| 102 | +
|
| 103 | + - name: Upload To Artifact |
| 104 | + if: github.ref != 'refs/heads/main' |
| 105 | + uses: actions/upload-artifact@v3 |
| 106 | + with: |
| 107 | + name: fbttf-linux.tar.gz |
| 108 | + path: ./fbttf-linux.tar.gz |
| 109 | + |
| 110 | + - name: Upload To Artifact |
| 111 | + if: github.ref != 'refs/heads/main' |
| 112 | + uses: actions/upload-artifact@v3 |
| 113 | + with: |
| 114 | + name: fbttf-linux.sh |
| 115 | + path: ./fbttf-linux.sh |
| 116 | + |
| 117 | + release-macos: |
| 118 | + runs-on: macos-latest |
| 119 | + needs: [release-create] |
| 120 | + permissions: |
| 121 | + contents: write |
| 122 | + |
| 123 | + steps: |
| 124 | + - name: Checkout |
| 125 | + uses: actions/checkout@v4 |
| 126 | + |
| 127 | + - name: Install dependencies |
| 128 | + run: zsh ./scripts/install-deps-macos.sh |
| 129 | + |
| 130 | + - name: Build |
| 131 | + run: zsh ./scripts/bundle-macos.sh |
| 132 | + |
| 133 | + - name: Upload To Release |
| 134 | + if: github.ref == 'refs/heads/main' |
| 135 | + env: |
| 136 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 137 | + run: | |
| 138 | + gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-macos.zip |
| 139 | + gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-macos.dmg |
| 140 | +
|
| 141 | + - name: Upload To Artifact |
| 142 | + if: github.ref != 'refs/heads/main' |
| 143 | + uses: actions/upload-artifact@v3 |
| 144 | + with: |
| 145 | + name: fbttf-macos.dmg |
| 146 | + path: ./fbttf-macos.dmg |
| 147 | + |
| 148 | + - name: Upload To Artifact |
| 149 | + if: github.ref != 'refs/heads/main' |
| 150 | + uses: actions/upload-artifact@v3 |
| 151 | + with: |
| 152 | + name: fbttf-macos.zip |
| 153 | + path: ./fbttf-macos.zip |
0 commit comments