add optional schema migrations; default to olm.bundle.object instead of olm.csv.metadata #1930
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: goreleaser | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: {} | |
merge_group: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
release: | |
needs: | |
- build-windows | |
- build-darwin | |
- build-linux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- run: | | |
for dist in dist-*; do | |
tar -C "${dist}" -xf "${dist}/${dist}.tar" | |
done | |
- name: Create assets | |
run: | | |
set -xe | |
mkdir -p assets | |
cat dist-*/dist/checksums.txt > assets/checksums.txt | |
for asset in dist-*/dist/*_*/*; do | |
base=$(basename "${asset}") | |
variant=$(basename $(dirname "${asset}") | cut -d_ -f1) | |
cp "${asset}" "assets/${variant}-${base}" | |
done | |
find assets -ls | |
cat assets/checksums.txt | |
- name: Upload Release Assets | |
if: github.ref_type == 'tag' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release create "${{ github.ref_name }}" --generate-notes ./assets/* | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# GoReleaser requires fetch-depth: 0 to correctly | |
# run git describe | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: "Run GoReleaser" | |
run: make release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_ARGS: release --rm-dist -f release/goreleaser.windows.yaml --skip-validate ${{ github.event_name == 'pull_request' && '--snapshot' || '' }} | |
- run: tar -cvf dist-windows.tar dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-windows | |
path: dist-windows.tar | |
build-darwin: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# GoReleaser requires fetch-depth: 0 to correctly | |
# run git describe | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: "Run GoReleaser" | |
run: make release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_ARGS: release --rm-dist -f release/goreleaser.darwin.yaml --skip-validate ${{ github.event_name == 'pull_request' && '--snapshot' || '' }} | |
- run: gtar -cvf dist-darwin.tar dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-darwin | |
path: dist-darwin.tar | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# GoReleaser requires fetch-depth: 0 to correctly | |
# run git describe | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: "Install linux cross-compilers" | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-s390x-linux-gnu gcc-powerpc64le-linux-gnu | |
- name: "Set the image tag" | |
run: | | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
# Release tags. | |
echo IMAGE_TAG="${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
elif [[ $GITHUB_REF == refs/heads/* ]]; then | |
# Branch build. | |
echo IMAGE_TAG="$(echo "${GITHUB_REF#refs/heads/}" | sed -r 's|/+|-|g')" >> $GITHUB_ENV | |
elif [[ $GITHUB_REF == refs/pull/* ]]; then | |
# PR build. | |
echo IMAGE_TAG="pr-$(echo "${GITHUB_REF}" | sed -E 's|refs/pull/([^/]+)/?.*|\1|')" >> $GITHUB_ENV | |
else | |
echo IMAGE_TAG="$(git describe --tags --always)" >> $GITHUB_ENV | |
fi | |
- name: "Login to Quay" | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
registry: quay.io | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: "Run GoReleaser" | |
run: make release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_ARGS: release --rm-dist -f release/goreleaser.linux.yaml --skip-validate ${{ github.event_name == 'pull_request' && '--snapshot' || '' }} | |
- run: tar -cvf dist-linux.tar dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-linux | |
path: dist-linux.tar |