Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENP-2825: Automatically trigger builds on push #156

Merged
merged 7 commits into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 21 additions & 35 deletions .github/workflows/build-protoc.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,48 @@
# yamllint disable rule:line-length
---
name: Build protoc
run-name: Build ${{ github.event.inputs.image }} with release tag ${{ github.event.inputs.release_tag }}
run-name: Build protoc

# yamllint disable-line rule:truthy
on:
push:
workflow_dispatch:
inputs:
image:
type: choice
description: Image
required: true
default: 'protoc'
options:
- protoc
- protoc-cpp
- protoc-go
- protoc-java
- protoc-node
- protoc-swift
- protoc-web
release_tag:
description: 'Create release tag'
required: false
type: boolean

jobs:
protoc:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
strategy:
# ensure protoc is built first
max-parallel: 1
matrix:
image:
- protoc
- protoc-cpp
- protoc-go
- protoc-java
- protoc-node
- protoc-swift
- protoc-web
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
- uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: linux/amd64,linux/arm64

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Publish
- run: ./publish.sh
env:
RELEASE_TAG: ${{ github.event.inputs.release_tag }}
IMAGE: ${{ github.event.inputs.image }}
run: ./publish.sh
RELEASE_TAG: ${{ github.ref_name == github.event.repository.default_branch }}
IMAGE: ${{ matrix.image }}