mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 00:22:14 +01:00
ci(workflows): multiple jobs multiple architectures build and push
This commit is contained in:
58
.github/workflows/continuous-delivery.yml
vendored
Normal file
58
.github/workflows/continuous-delivery.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: Continuous Delivery
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
release_amd64:
|
||||
name: Release linux/amd64
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-latest'
|
||||
platform: 'linux/amd64'
|
||||
gotenberg_version: ${{ github.event.release.tag_name }}
|
||||
|
||||
release_386:
|
||||
name: Release linux/386
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-latest'
|
||||
platform: 'linux/386'
|
||||
gotenberg_version: ${{ github.event.release.tag_name }}
|
||||
|
||||
release_arm64:
|
||||
name: Release linux/arm64
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-24.04-arm'
|
||||
platform: 'linux/arm64'
|
||||
gotenberg_version: ${{ github.event.release.tag_name }}
|
||||
|
||||
release_arm_v7:
|
||||
name: Release linux/arm/v7
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-24.04-arm'
|
||||
platform: 'linux/arm/v7'
|
||||
gotenberg_version: ${{ github.event.release.tag_name }}
|
||||
|
||||
merge_clean_release_tags:
|
||||
needs:
|
||||
- release_amd64
|
||||
- release_386
|
||||
- release_arm64
|
||||
- release_arm_v7
|
||||
name: Merge and clean release tags
|
||||
uses: ./.github/workflows/gotenberg-merge-clean.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
tags: "${{ needs.release_amd64.outputs.tags }},${{ needs.release_386.outputs.tags }},${{ needs.release_arm64.outputs.tags }},${{ needs.release_arm_v7.outputs.tags }}"
|
||||
alternate_registry: 'thecodingmachine'
|
||||
190
.github/workflows/continuous-integration.yml
vendored
Normal file
190
.github/workflows/continuous-integration.yml
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
name: Continuous Integration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{ (github.event_name == 'pull_request' && github.event.pull_request.number) || 'main' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.23'
|
||||
cache: false
|
||||
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run linters
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: v1.63.4
|
||||
|
||||
tests:
|
||||
needs:
|
||||
- lint
|
||||
name: Tests
|
||||
# TODO: once arm64 actions are available, also run the tests on this architecture.
|
||||
# See: https://github.com/actions/virtual-environments/issues/2552#issuecomment-771478000.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build testing environment
|
||||
run: make build build-tests
|
||||
|
||||
- name: Run tests
|
||||
run: make tests-once
|
||||
|
||||
- name: Upload to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
verbose: true
|
||||
|
||||
snapshot_amd64:
|
||||
if: github.event_name == 'pull_request'
|
||||
needs:
|
||||
- tests
|
||||
name: Snapshot linux/amd64
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-latest'
|
||||
platform: 'linux/amd64'
|
||||
gotenberg_version: pr-${{ github.event.pull_request.number }}
|
||||
alternate_repository: 'snapshot'
|
||||
|
||||
snapshot_386:
|
||||
if: github.event_name == 'pull_request'
|
||||
needs:
|
||||
- tests
|
||||
name: Snapshot linux/386
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-latest'
|
||||
platform: 'linux/386'
|
||||
gotenberg_version: pr-${{ github.event.pull_request.number }}
|
||||
alternate_repository: 'snapshot'
|
||||
|
||||
snapshot_arm64:
|
||||
if: github.event_name == 'pull_request'
|
||||
needs:
|
||||
- tests
|
||||
name: Snapshot linux/arm64
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-24.04-arm'
|
||||
platform: 'linux/arm64'
|
||||
gotenberg_version: pr-${{ github.event.pull_request.number }}
|
||||
alternate_repository: 'snapshot'
|
||||
|
||||
snapshot_arm_v7:
|
||||
if: github.event_name == 'pull_request'
|
||||
needs:
|
||||
- tests
|
||||
name: Snapshot linux/arm/v7
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-24.04-arm'
|
||||
platform: 'linux/arm/v7'
|
||||
gotenberg_version: pr-${{ github.event.pull_request.number }}
|
||||
alternate_repository: 'snapshot'
|
||||
|
||||
merge_clean_snapshot_tags:
|
||||
needs:
|
||||
- snapshot_amd64
|
||||
- snapshot_386
|
||||
- snapshot_arm64
|
||||
- snapshot_arm_v7
|
||||
name: Merge and clean snapshot tags
|
||||
uses: ./.github/workflows/gotenberg-merge-clean.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
tags: "${{ needs.snapshot_amd64.outputs.tags }},${{ needs.snapshot_386.outputs.tags }},${{ needs.snapshot_arm64.outputs.tags }},${{ needs.snapshot_arm_v7.outputs.tags }}"
|
||||
|
||||
edge_amd64:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
needs:
|
||||
- tests
|
||||
name: Edge linux/amd64
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-latest'
|
||||
platform: 'linux/amd64'
|
||||
gotenberg_version: 'edge'
|
||||
|
||||
edge_386:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
needs:
|
||||
- tests
|
||||
name: Edge linux/386
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-latest'
|
||||
platform: 'linux/386'
|
||||
gotenberg_version: 'edge'
|
||||
|
||||
edge_arm64:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
needs:
|
||||
- tests
|
||||
name: Edge linux/arm64
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-24.04-arm'
|
||||
platform: 'linux/arm64'
|
||||
gotenberg_version: 'edge'
|
||||
|
||||
edge_arm_v7:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
needs:
|
||||
- tests
|
||||
name: Edge linux/arm/v7
|
||||
uses: ./.github/workflows/gotenberg-build-push.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
runs_on: 'ubuntu-24.04-arm'
|
||||
platform: 'linux/arm/v7'
|
||||
gotenberg_version: 'edge'
|
||||
|
||||
merge_clean_edge_tags:
|
||||
needs:
|
||||
- edge_amd64
|
||||
- edge_386
|
||||
- edge_arm64
|
||||
- edge_arm_v7
|
||||
name: Merge and clean edge tags
|
||||
uses: ./.github/workflows/gotenberg-merge-clean.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
tags: "${{ needs.edge_amd64.outputs.tags }},${{ needs.edge_386.outputs.tags }},${{ needs.edge_arm64.outputs.tags }},${{ needs.edge_arm_v7.outputs.tags }}"
|
||||
alternate_registry: 'thecodingmachine'
|
||||
29
.github/workflows/continuous_delivery.yml
vendored
29
.github/workflows/continuous_delivery.yml
vendored
@@ -1,29 +0,0 @@
|
||||
name: Continuous Delivery
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release Docker image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
- name: Log in to Docker Hub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push Docker image for release
|
||||
run: |
|
||||
make release GOTENBERG_VERSION=${{ github.event.release.tag_name }}
|
||||
make release GOTENBERG_VERSION=${{ github.event.release.tag_name }} DOCKER_REGISTRY=thecodingmachine
|
||||
102
.github/workflows/continuous_integration.yml
vendored
102
.github/workflows/continuous_integration.yml
vendored
@@ -1,102 +0,0 @@
|
||||
name: Continuous Integration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{ (github.event_name == 'pull_request' && github.event.pull_request.number) || 'main' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.23'
|
||||
cache: false
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
- name: Run linters
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: v1.63.4
|
||||
|
||||
tests:
|
||||
needs:
|
||||
- lint
|
||||
name: Tests
|
||||
# TODO: once arm64 actions are available, also run the tests on this architecture.
|
||||
# See: https://github.com/actions/virtual-environments/issues/2552#issuecomment-771478000.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
- name: Build testing environment
|
||||
run: make build build-tests
|
||||
- name: Run tests
|
||||
run: make tests-once
|
||||
- name: Upload to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
verbose: true
|
||||
|
||||
snapshot_release:
|
||||
if: github.event_name == 'pull_request'
|
||||
needs:
|
||||
- tests
|
||||
name: Snapshot release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
- name: Log in to Docker Hub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push snapshot Docker image (linux/amd64)
|
||||
run: make release GOTENBERG_VERSION=${{ github.head_ref }} DOCKER_REPOSITORY=snapshot LINUX_AMD64_RELEASE=true
|
||||
|
||||
edge_release:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
needs:
|
||||
- tests
|
||||
name: Edge release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
- name: Log in to Docker Hub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push Docker image for main branch
|
||||
run: |
|
||||
make release GOTENBERG_VERSION=edge
|
||||
make release GOTENBERG_VERSION=edge DOCKER_REGISTRY=thecodingmachine
|
||||
51
.github/workflows/gotenberg-build-push.yml
vendored
Normal file
51
.github/workflows/gotenberg-build-push.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runs_on:
|
||||
type: string
|
||||
required: true
|
||||
platform:
|
||||
type: string
|
||||
required: true
|
||||
gotenberg_version:
|
||||
type: string
|
||||
required: true
|
||||
alternate_repository:
|
||||
type: string
|
||||
default: ''
|
||||
outputs:
|
||||
tags:
|
||||
value: ${{ jobs.gotenberg_build_push.outputs.tags }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
gotenberg_build_push:
|
||||
runs-on: ${{ inputs.runs_on }}
|
||||
outputs:
|
||||
tags: ${{ steps.build_push.outputs.tags }}
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push ${{ inputs.platform }}
|
||||
id: build_push
|
||||
uses: gotenberg/gotenberg-release-action@main
|
||||
with:
|
||||
step: build_push
|
||||
version: ${{ inputs.gotenberg_version }}
|
||||
platform: ${{ inputs.platform }}
|
||||
alternate_repository: ${{ inputs.alternate_repository }}
|
||||
40
.github/workflows/gotenberg-merge-clean.yml
vendored
Normal file
40
.github/workflows/gotenberg-merge-clean.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
tags:
|
||||
type: string
|
||||
required: true
|
||||
alternate_registry:
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
gotenberg_merge_clean:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Merge and clean
|
||||
uses: gotenberg/gotenberg-release-action@main
|
||||
with:
|
||||
step: merge_clean
|
||||
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
tags: ${{ inputs.tags }}
|
||||
alternate_registry: ${{ inputs.alternate_registry }}
|
||||
Reference in New Issue
Block a user