From: Ardis Lu Date: Wed, 6 Jul 2022 03:23:40 +0000 (-0700) Subject: Add GitHub Action to create releases X-Git-Tag: v0.1.0^0 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=f46905d6ff62170b8bfb0738b22204dc03eaeb67;p=random-word-generator Add GitHub Action to create releases --- 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 }}