From f46905d6ff62170b8bfb0738b22204dc03eaeb67 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Tue, 5 Jul 2022 20:23:40 -0700 Subject: [PATCH] Add GitHub Action to create releases --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c663950 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: + push: + tags: ["v*"] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup deno + uses: denoland/setup-deno@v1 + with: + deno-version: "1.23.2" + + - name: Compile executables + run: | + deno compile --output ./build/rwg-x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu --allow-read main.ts + deno compile --output ./build/rwg-x86_64-pc-windows-msvc --target x86_64-pc-windows-msvc --allow-read main.ts + deno compile --output ./build/rwg-x86_64-apple-darwin --target x86_64-apple-darwin --allow-read main.ts + deno compile --output ./build/rwg-aarch64-apple-darwin --target aarch64-apple-darwin --allow-read main.ts + + - name: Create GitHub release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload executables to GitHub release + uses: csexton/release-asset-action@v2 + with: + pattern: "./build/*" + github-token: ${{ secrets.GITHUB_TOKEN }} + release-url: ${{ steps.create_release.outputs.upload_url }} -- 2.47.3