From 07d3fb4b5e6c8dcc78d0752a3ca9fcffa2768a5e Mon Sep 17 00:00:00 2001 From: Christian Benincasa Date: Wed, 17 Jul 2024 14:26:13 -0400 Subject: [PATCH] chore: attempt 1 at more automated releases --- .../workflows/build-and-push-docker-edge.yml | 26 +++++++++++++- .../build-and-release-edge-binary.yml | 2 +- .github/workflows/build-nexe-binaries.yml | 20 ----------- .github/workflows/build-nix-nexe.yml | 13 ++++--- .github/workflows/build.yml | 35 ------------------- .github/workflows/docs.yml | 2 +- 6 files changed, 36 insertions(+), 62 deletions(-) delete mode 100644 .github/workflows/build-nexe-binaries.yml delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build-and-push-docker-edge.yml b/.github/workflows/build-and-push-docker-edge.yml index 04d8103ab..fd73edf08 100644 --- a/.github/workflows/build-and-push-docker-edge.yml +++ b/.github/workflows/build-and-push-docker-edge.yml @@ -1,7 +1,10 @@ -name: Push Docker Edge +name: Build & Push Docker Edge on: workflow_dispatch: + push: + tags: + - 'v*' schedule: - cron: '0 13-21/2 * * MON-FRI' # every hour, during working hours (UTC) @@ -20,32 +23,51 @@ jobs: chrisbenincasa/tunarr:latest ghcr.io/chrisbenincasa/tunarr:latest platform: linux/amd64 + suffix: - base_tag: 7.0-nvidia tags: | chrisbenincasa/tunarr:edge-nvidia ghcr.io/chrisbenincasa/tunarr:edge-nvidia platform: linux/amd64 + suffix: -nvidia - base_tag: 7.0-vaapi tags: | chrisbenincasa/tunarr:edge-vaapi ghcr.io/chrisbenincasa/tunarr:edge-vaapi platform: linux/amd64 + suffix: -vaapi - base_tag: 7.0-arm64 tags: | chrisbenincasa/tunarr:edge-arm64 ghcr.io/chrisbenincasa/tunarr:edge-arm64 platform: linux/arm64 + suffix: -arm64 - base_tag: 7.0-arm tags: | chrisbenincasa/tunarr:edge-arm ghcr.io/chrisbenincasa/tunarr:edge-arm platform: linux/arm/v7 + suffix: -arm steps: - uses: actions/checkout@v4 with: ref: dev + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + flavor: | + suffix=${{ matrix.builds.suffix }} + images: | + chrisbenincasa/tunarr + ghcr.io/chrisbenincasa/tunarr + tags: | + type=schedule,pattern=edge + type=semver,pattern={{version}} + type=raw,value=edge,enable=${{github.ref == format('refs/heads/{0}', 'dev') && github.event_name == 'workflow_dispatch'}} + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -83,6 +105,8 @@ jobs: exit 0 # Exit without pushing the image fi echo "PREVIOUS_HEAD_SHA=$HEAD_SHA" >> previous_head_sha # Save current SHA for next run + if: github.event_name == 'schedule' + - name: Generate Version Number run: | echo "TUNARR_VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV diff --git a/.github/workflows/build-and-release-edge-binary.yml b/.github/workflows/build-and-release-edge-binary.yml index aa47a2e95..81abee9f9 100644 --- a/.github/workflows/build-and-release-edge-binary.yml +++ b/.github/workflows/build-and-release-edge-binary.yml @@ -1,4 +1,4 @@ -name: Build Edge Binaries +name: Build & Publish Edge Binaries on: workflow_dispatch: diff --git a/.github/workflows/build-nexe-binaries.yml b/.github/workflows/build-nexe-binaries.yml deleted file mode 100644 index 582703ca7..000000000 --- a/.github/workflows/build-nexe-binaries.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build Binaries - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log into Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/build-nix-nexe.yml b/.github/workflows/build-nix-nexe.yml index c318b679f..7dd9487d8 100644 --- a/.github/workflows/build-nix-nexe.yml +++ b/.github/workflows/build-nix-nexe.yml @@ -9,10 +9,15 @@ jobs: strategy: matrix: os: - - name: macos-13 - binary_name: macos-x64 - - name: macos-14 - binary_name: macos-arm64 + # TODO: Is there a way to get these working? + # We don't build macOS Nexe binaries anymore because + # of code signing. + # - name: macos-13 + # binary_name: macos-x64 + # - name: macos-14 + # binary_name: macos-arm64 + # TODO: We can build ARM binaries, but we have to + # use a docker container and extract them - name: ubuntu-latest binary_name: linux-x64 node_version: [20.11.1] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index b5a8e573c..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build Release - -on: - workflow_dispatch: - inputs: - tag: - required: true - type: string - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - push: true - file: build.Dockerfile - target: full-stack - tags: chrisbenincasa/tunarr:${{ inputs.tag }}-test - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e2f032135..488a37def 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,4 @@ -name: Public Docs +name: Publish Docs on: push: branches: