diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 328044dc6..cd2e0bcdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,7 @@ jobs: discord: name: Send Discord Notification needs: build_and_push + if: always() && github.event_name != 'pull_request' runs-on: ubuntu-20.04 steps: - name: Get Build Job Status diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 10158ab66..e8412f61e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: jobs: test: + name: Lint & Test Build runs-on: ubuntu-20.04 container: node:12.18-alpine steps: @@ -41,9 +42,61 @@ jobs: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} run: npx semantic-release + build-snap: + name: Build Snap Package (${{ matrix.architecture }}) + needs: semantic-release + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + architecture: + - amd64 + - arm64 + - armhf + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Prepare + id: prepare + run: | + git fetch --prune --unshallow --tags + if [[ $GITHUB_REF == refs/tags/* || $GITHUB_REF == refs/heads/master ]]; then + echo ::set-output name=RELEASE::stable + else + echo ::set-output name=RELEASE::edge + fi + + - name: Set Up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Build Snap Package + uses: diddlesnaps/snapcraft-multiarch-action@v1 + id: build + with: + architecture: ${{ matrix.architecture }} + + - name: Upload Snap Package + uses: actions/upload-artifact@v2 + with: + name: overseerr-snap-package-${{ matrix.architecture }} + path: ${{ steps.build.outputs.snap }} + + - name: Review Snap Package + uses: diddlesnaps/snapcraft-review-tools-action@v1 + with: + snap: ${{ steps.build.outputs.snap }} + + - name: Publish Snap Package + uses: snapcore/action-publish@v1 + with: + store_login: ${{ secrets.SNAP_LOGIN }} + snap: ${{ steps.build.outputs.snap }} + release: ${{ steps.prepare.outputs.RELEASE }} discord: name: Send Discord Notification needs: semantic-release + if: always() runs-on: ubuntu-20.04 steps: - name: Get Build Job Status diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index 4d415ae3e..e0b100bf2 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -3,8 +3,6 @@ name: Publish Snap on: push: branches: [develop] - tags: [v*] - pull_request: ~ jobs: test: @@ -74,10 +72,10 @@ jobs: store_login: ${{ secrets.SNAP_LOGIN }} snap: ${{ steps.build.outputs.snap }} release: ${{ steps.prepare.outputs.RELEASE }} - discord: name: Send Discord Notification needs: build-snap + if: always() runs-on: ubuntu-20.04 steps: - name: Get Build Job Status