-
Notifications
You must be signed in to change notification settings - Fork 17
69 lines (67 loc) · 2.4 KB
/
release.yml
File metadata and controls
69 lines (67 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: release to quay.io
on:
push:
tags: [v*]
env:
WF_REGISTRY_USER: netobserv+github_ci
WF_ORG: netobserv
WF_MULTIARCH_TARGETS: amd64 arm64 ppc64le s390x
jobs:
push-image:
name: push image and prepare release
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: validate tag
run: |
tag=`git describe --exact-match --tags 2> /dev/null`
if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; 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
# QEMU and buildx needed for multiarch builds (otherwise, microdnf step fails)
- name: Set up QEMU dependency
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: set up go 1.x
uses: actions/setup-go@v3
with:
go-version: '1.25'
- 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: build and push manifest with images
run: MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.tag }} CLEAN_BUILD=1 make images
- name: build plugin artifact
run: IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.tag }} make release
- name: create github release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: false
release_name: ${{ env.tag }}
tag_name: ${{ env.tag }}
body: Edit to remove this content, click on 'generate release notes' above and publish. It will trigger the krew-release-bot.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: push plugin artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: netobserv-cli.tar.gz
asset_name: netobserv-cli.tar.gz
asset_content_type: application/gzip