From 14136dfdf1890831c726aac0bf548507c054d273 Mon Sep 17 00:00:00 2001 From: Aaron Elkiss Date: Wed, 24 Apr 2024 11:48:20 -0400 Subject: [PATCH] Use our own github actions --- .github/workflows/build.yml | 51 ++++++++++++++++++++++++ .github/workflows/tag-release.yml | 16 ++++++++ .github/workflows/{ci.yaml => tests.yml} | 28 +------------ 3 files changed, 68 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/tag-release.yml rename .github/workflows/{ci.yaml => tests.yml} (86%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..b682e0943e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: Build A Branch + +on: + workflow_run: + workflows: ['Run Tests'] + branches: ['master'] + types: [completed] + + workflow_dispatch: + inputs: + img_tag: + description: Docker Image Tag + ref: + description: Revision or Branch to build + default: master + push_latest: + description: Set True if the build is for the latest version + type: boolean + required: false + default: false + platforms: + description: Platforms to build for + type: choice + default: linux/amd64,linux/arm64 + options: + - linux/amd64,linux/arm64 + - linux/amd64 + - linux/arm64 + rebuild: + description: Rebuild this image? + type: boolean + default: false + +jobs: + build-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Build Image + uses: hathitrust/github_actions/build@v1.4.0 + with: + image: ghcr.io/${{ github.repository }}-unstable + dockerfile: Dockerfile + img_tag: ${{ inputs.img_tag }} + tag: ${{ inputs.ref }} + push_latest: ${{ inputs.push_latest}} + registry_token: ${{ github.token }} + rebuild: ${{ inputs.rebuild }} \ No newline at end of file diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml new file mode 100644 index 0000000000..5ad7db55a7 --- /dev/null +++ b/.github/workflows/tag-release.yml @@ -0,0 +1,16 @@ +name: Docker Tag Latest Release + +on: + release: + types: [released] + +jobs: + tag-release: + runs-on: ubuntu-latest + steps: + - uses: hathitrust/github_actions/tag-release@v1 + with: + registry_token: ${{ github.token }} + existing_tag: ghcr.io/${{ github.repository }}-unstable:${{ github.sha }} + image: ghcr.io/${{ github.repository }} + new_tag: ${{ github.event.release.tag_name }} \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/tests.yml similarity index 86% rename from .github/workflows/ci.yaml rename to .github/workflows/tests.yml index fc7dd38b25..1aa7983f60 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: CI +name: Run Tests on: push: @@ -149,29 +149,3 @@ jobs: - name: Lint run: make lint - - artifacts: - name: Artifacts - uses: ./.github/workflows/artifacts.yaml - with: - publish: ${{ github.event_name == 'push' }} - secrets: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - permissions: - contents: read - packages: write - id-token: write - security-events: write - - dependency-review: - name: Dependency review - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - - steps: - - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - - name: Dependency Review - uses: actions/dependency-review-action@5bbc3ba658137598168acb2ab73b21c432dd411b # v4.2.5