]> git.ardis.lu - random-word-generator/commitdiff
Add GitHub Action to create releases v0.1.0
authorArdis Lu <ardisglu@gmail.com>
Wed, 6 Jul 2022 03:23:40 +0000 (20:23 -0700)
committerArdis Lu <ardisglu@gmail.com>
Wed, 6 Jul 2022 03:25:02 +0000 (20:25 -0700)
.github/workflows/release.yml [new file with mode: 0644]

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644 (file)
index 0000000..c663950
--- /dev/null
@@ -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 }}
This page took 0.046466 seconds and 4 git commands to generate.