Skip to content

Prepare release v1.10.0-community #98

Prepare release v1.10.0-community

Prepare release v1.10.0-community #98

Workflow file for this run

name: release to quay.io
on:
push:
tags: ['*']
env:
WF_REGISTRY_USER: netobserv+github_ci
WF_REGISTRY: quay.io/netobserv
WF_IMAGE: network-observability-operator
WF_ORG: netobserv
WF_MULTIARCH_TARGETS: amd64 arm64 ppc64le s390x
jobs:
push-image:
name: push image
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: docker login to quay.io
uses: docker/login-action@v2
with:
username: ${{ env.WF_REGISTRY_USER }}
password: ${{ secrets.QUAY_SECRET }}
registry: quay.io
- name: validate tag
run: |
tag=`git describe --exact-match --tags 2> /dev/null`
if [[ $tag =~ ^[0-9]+\.[0-9]+\.[0-9]+(-crc[0-9]+|-community)$ ]]; then
echo "$tag is a valid release tag"
set -e
echo "tag=$tag" >> $GITHUB_ENV
else
echo "$tag is NOT a valid release tag"
exit 1
fi
- name: install make
run: sudo apt-get install make
- name: set up go 1.x
uses: actions/setup-go@v3
with:
go-version: '1.24'
- name: build operator
run: |
MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} IMAGE=${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.tag }} CLEAN_BUILD=1 make image-build
- name: push operator
run: |
MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} IMAGE=${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.tag }} make image-push
- name: build and push manifest
run: |
MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} IMAGE=${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.tag }} make manifest-build manifest-push
- name: build bundle
run: IMAGE_ORG=${{ env.WF_ORG }} BUNDLE_VERSION=${{ env.tag }} CLEAN_BUILD=1 make bundle-build
- name: push bundle to quay.io
run: IMAGE_ORG=${{ env.WF_ORG }} BUNDLE_VERSION=${{ env.tag }} make bundle-push
- name: build catalog
run: IMAGE_ORG=${{ env.WF_ORG }} BUNDLE_VERSION=${{ env.tag }} make catalog-build
- name: push catalog to quay.io
run: IMAGE_ORG=${{ env.WF_ORG }} BUNDLE_VERSION=${{ env.tag }} make catalog-push
- name: extract binaries
run: MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.tag }} make extract-binaries
- name: create draft release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.tag }}
release_name: ${{ env.tag }}
draft: true
prerelease: false
- name: upload binaries
uses: actions/github-script@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs').promises;
const upload_url = '${{ steps.create_release.outputs.upload_url }}';
for (let file of await fs.readdir('./release-assets')) {
console.log('uploading', file);
await github.repos.uploadReleaseAsset({
url: upload_url,
name: file,
data: await fs.readFile(`./release-assets/${file}`)
});
}