-
Notifications
You must be signed in to change notification settings - Fork 10
75 lines (72 loc) · 2.3 KB
/
release-image.yaml
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
70
71
72
73
74
75
name: Release Hwameistor Operator
on:
push:
branches:
- main
paths:
- "helm/operator/Chart.yaml"
workflow_dispatch:
inputs:
release_tag:
required: true
type: string
branch:
required: true
type: string
jobs:
release-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.7.1
- name: Set env
run: echo "GIT_ORG=$( echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z' )" >> $GITHUB_ENV
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: helm
charts_repo_url: https://${GIT_ORG}.github.io/hwameistor-operator
config: helm/.cr/config.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
release-image:
runs-on: ubuntu-latest
needs:
- release-chart
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ inputs.branch }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Login registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Set env
run: |
echo "RELEASE_TAG=`[ "${{ inputs.release_tag }}" != "" ] && echo ${{ inputs.release_tag }} || echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
echo "PROJECT_SOURCE_CODE_DIR=`echo ${GITHUB_WORKSPACE}`" >> $GITHUB_ENV
echo "IMAGE_REGISTRY=`echo ghcr.io/$(echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z')`" >> $GITHUB_ENV
- name: Release image
run: |
PROJECT_SOURCE_CODE_DIR=${PROJECT_SOURCE_CODE_DIR} IMAGE_REGISTRY=${IMAGE_REGISTRY} RELEASE_TAG=${RELEASE_TAG} make release