This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
Update README.md - Add deprecation notice (#77) #28
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: release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
goreleaser: | |
name: goreleaser | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ~1.18 | |
- name: Install GoReleaser | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
install-only: true | |
- name: Docker Login | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v2 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Set the release related variables | |
run: | | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
# Release tags. | |
echo IMAGE_TAG="${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
echo GORELEASER_ARGS="--rm-dist" >> $GITHUB_ENV | |
echo DISABLE_RELEASE_PIPELINE=false >> $GITHUB_ENV | |
elif [[ $GITHUB_REF == refs/heads/* ]]; then | |
# Branch build. | |
echo IMAGE_TAG="$(echo "${GITHUB_REF#refs/heads/}" | sed -r 's|/+|-|g')" >> $GITHUB_ENV | |
echo GORELEASER_ARGS="--rm-dist --skip-validate" >> $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: Generate oria-operator release manifests | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
run: make release-manifests | |
- name: Run goreleaser | |
run: make release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} |