From 4d41cf454766f8e7c830ac67261adc1b62bebbf4 Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Sun, 28 Mar 2021 08:22:27 -0700 Subject: [PATCH] chore: add release job --- .github/workflows/main.yml | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0df88c5c7..106fff4b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -196,6 +196,61 @@ jobs: asset_name: unraid-api.tgz asset_content_type: application/gzip + - name: Create Sentry release + uses: getsentry/action-release@v1 + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} + with: + environment: prerelease + + release: + # Only release if this is a version tag + if: | + startsWith(github.ref, 'refs/tags/v') && + (!contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc')) + runs-on: ubuntu-latest + + needs: [build-binary] + + steps: + - name: Checkout repo + uses: actions/checkout@v1 + + - name: Add SSH deploy key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.UNRAID_BOT_SSH_KEY }} + known_hosts: ${{ secrets.KNOWN_HOSTS }} + + - name: Download unraid-api binary tgz + uses: actions/download-artifact@v2 + with: + name: unraid-api + + - 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 release assets + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./unraid-api.tgz + asset_name: unraid-api.tgz + asset_content_type: application/gzip + - name: Create Sentry release uses: getsentry/action-release@v1 env: @@ -204,3 +259,4 @@ jobs: SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} with: environment: production + version: ${{ github.ref }}