Skip to content

fix: update github workflow to use node>=16 (#336) #212

fix: update github workflow to use node>=16 (#336)

fix: update github workflow to use node>=16 (#336) #212

Workflow file for this run

# Decide between Pre-Release and Development Release
name: release
on:
push:
branches: [main]
jobs:
e2e-tests-olm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV
- name: e2e tests through OLM
uses: ./.github/e2e-tests-olm
with:
go-version: ${{ env.go-version }}
publish-olm-development:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
runs-on: ubuntu-latest
environment: quay
needs:
- e2e-tests-olm
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV
# Bumping the version in the next step will also run code generation scripts
# that depend on controller-gen.
# Therefore, we first need to setup Go so that we can install the
# controller-gen binary.
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
check-latest: true
cache: true
- name: Set version
id: version
run: |
npx standard-version --skip.commit --skip.tag --skip.changelog
version="$(cat VERSION)-$(date +%y%m%d%H%M%S)"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Publish OLM
uses: ./.github/olm-publish
env:
IMAGE_BASE: ${{ secrets.IMAGE_BASE }}
VERSION: ${{ steps.version.outputs.version }}
CHANNELS: development
RELEASE_SHA: ${GITHUB_SHA}
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
go-version: ${{ env.go-version }}
- name: Push catalog index changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.REPOSITORY_PUSH_TOKEN }}
branch: olm-catalog
- name: Publish Package
uses: ./.github/package-operator-publish
env:
IMAGE_BASE: ${{ secrets.IMAGE_BASE }}
VERSION: ${{ steps.version.outputs.version }}
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
go-version: ${{ env.go-version }}
create-github-prerelease:
needs:
- e2e-tests-olm
runs-on: ubuntu-latest
if: "startsWith(github.event.head_commit.message, 'chore(release):')"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.REPOSITORY_PUSH_TOKEN }}
- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV
# Bumping the version in the next step will also run code generation scripts
# that depend on controller-gen.
# Therefore, we first need to setup Go so that we can install the
# controller-gen binary.
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
check-latest: true
cache: true
- name: Generate release notes
run: |
# Create the release notes for the Github release
git config user.name rhobs-release-bot
git config user.email release-bot@monitoring.rhobs.io
npx standard-version -i RELEASE_BODY.md \
--release-as $(cat VERSION) \
--skip.commit
- name: Publish tag
id: publish_tag
run: |
# NOTE tag is created by standard-version and points to the
# chore(release): commit
git push --follow-tags
echo "tag_name=$(git describe HEAD --abbrev=0)" >> $GITHUB_OUTPUT
- name: Create Github release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.publish_tag.outputs.tag_name }}
bodyFile: RELEASE_BODY.md
# NOTE: We always generate pre-releases and mark them as releases manually
prerelease: true
publish-olm-candidate:
needs:
- create-github-prerelease
runs-on: ubuntu-latest
environment: quay
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.REPOSITORY_PUSH_TOKEN }}
- name: Import common environment variables
run: cat ".github/env" >> "$GITHUB_ENV"
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
check-latest: true
cache: true
- name: Set version
id: version
run: |
version="$(cat VERSION)-rc"
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: publish catalog
uses: ./.github/olm-publish
env:
IMAGE_BASE: ${{ secrets.IMAGE_BASE }}
VERSION: ${{ steps.version.outputs.version }}
CHANNELS: candidate,development
DEFAULT_CHANNEL: candidate
RELEASE_SHA: ${GITHUB_SHA}
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
go-version: ${{ env.go-version }}
- name: Push catalog index changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.REPOSITORY_PUSH_TOKEN }}
branch: olm-catalog
- name: Publish Package
uses: ./.github/package-operator-publish
env:
IMAGE_BASE: ${{ secrets.IMAGE_BASE }}
VERSION: ${{ steps.version.outputs.version }}
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
go-version: ${{ env.go-version }}