From d6aa35583e4be14304d2a17c7d11c8819756beb6 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 6 Oct 2022 18:20:19 -0700 Subject: [PATCH] Add new-release action to automatically build & publish release artifacts --- .github/workflows/new-release.yml | 83 +++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/new-release.yml diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml new file mode 100644 index 000000000..901433234 --- /dev/null +++ b/.github/workflows/new-release.yml @@ -0,0 +1,83 @@ +name: new-release + +on: + workflow_dispatch: + inputs: + version: + required: true + description: Release version including 0. + +permissions: + contents: write + +jobs: + create-release: + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - name: create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.inputs.version }} + release_name: ${{ github.event.inputs.version }} + draft: true + + build: + needs: ["create-release"] + strategy: + matrix: + os: [ubuntu, macos, windows] + name: ${{matrix.os}} + runs-on: ${{matrix.os}}-latest + steps: + - uses: actions/checkout@v1 + - name: configure + run: cmake . -DCMAKE_BUILD_TYPE=Release + - name: build + run: cmake --build . --target Luau.Repl.CLI Luau.Analyze.CLI --config Release -j 2 + - name: pack + if: matrix.os != 'windows' + run: zip luau-${{matrix.os}}.zip luau* + - name: pack + if: matrix.os == 'windows' + run: 7z a luau-${{matrix.os}}.zip .\Release\luau*.exe + - uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: luau-${{matrix.os}}.zip + asset_name: luau-${{matrix.os}}.zip + asset_content_type: application/octet-stream + + web: + needs: ["create-release"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + repository: emscripten-core/emsdk + path: emsdk + - name: emsdk install + run: | + cd emsdk + ./emsdk install latest + ./emsdk activate latest + - name: make + run: | + source emsdk/emsdk_env.sh + emcmake cmake . -DLUAU_BUILD_WEB=ON -DCMAKE_BUILD_TYPE=Release + make -j2 Luau.Web + - uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: Luau.Web.js + asset_name: Luau.Web.js + asset_content_type: application/octet-stream