|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - 'v*' |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + platform: |
| 12 | + - {name: windows, os: windows-2022} |
| 13 | + - {name: linux, os: ubuntu-22.04} |
| 14 | + arch: [x86_64, aarch64] |
| 15 | + runs-on: ${{ matrix.platform.os }} |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v3 |
| 19 | + |
| 20 | + - uses: CompeyDev/setup-rokit@v0.1.2 |
| 21 | + with: |
| 22 | + version: v1.2.0 |
| 23 | + cache: false |
| 24 | + token: ${{ github.token }} |
| 25 | + |
| 26 | + - name: Bundle Files |
| 27 | + run: darklua process src/Repackage.luau bundle/Bundled.luau -c bundle/darklua.config |
| 28 | + |
| 29 | + - name: Build (Windows) |
| 30 | + if: matrix.platform.name == 'windows' |
| 31 | + run: lune build bundle/Bundled.luau -o bundle/repackage.exe -t windows-${{ matrix.arch }} |
| 32 | + |
| 33 | + - name: Build (Linux) |
| 34 | + if: matrix.platform.name == 'linux' |
| 35 | + run: lune build bundle/Bundled.luau -o bundle/repackage -t linux-${{ matrix.arch }} |
| 36 | + |
| 37 | + - name: Upload Bundle Artifact |
| 38 | + uses: actions/upload-artifact@v4 |
| 39 | + with: |
| 40 | + name: repackage-${{ github.ref_name }}-${{ matrix.platform.name }}-${{ matrix.arch }} |
| 41 | + path: bundle/repackage* |
| 42 | + |
| 43 | + release: |
| 44 | + needs: build |
| 45 | + runs-on: ubuntu-latest |
| 46 | + permissions: |
| 47 | + contents: write |
| 48 | + steps: |
| 49 | + - name: Checkout |
| 50 | + uses: actions/checkout@v3 |
| 51 | + |
| 52 | + - name: Get Version |
| 53 | + id: version |
| 54 | + shell: bash |
| 55 | + run: | |
| 56 | + VERSION=$(bash scripts/get_version.sh) |
| 57 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 58 | + |
| 59 | + - name: Download artifacts |
| 60 | + uses: actions/download-artifact@v4 |
| 61 | + with: |
| 62 | + path: artifacts |
| 63 | + |
| 64 | + - name: Zip artifacts |
| 65 | + run: | |
| 66 | + cd artifacts |
| 67 | + for dir in */; do |
| 68 | + dirn="${dir%/}" |
| 69 | + cd "$dirn" |
| 70 | + zip "../../${dirn}.zip" * |
| 71 | + cd .. |
| 72 | + done |
| 73 | + cd .. |
| 74 | + ls -la *.zip |
| 75 | + |
| 76 | + - name: Create Release |
| 77 | + uses: softprops/action-gh-release@v1 |
| 78 | + with: |
| 79 | + name: ${{ steps.version.outputs.version }} |
| 80 | + tag_name: ${{ github.ref_name }} |
| 81 | + files: "*.zip" |
| 82 | + draft: false |
| 83 | + prerelease: false |
| 84 | + env: |
| 85 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments