-
Notifications
You must be signed in to change notification settings - Fork 62
49 lines (41 loc) · 1.39 KB
/
mcad-release.yml
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
# This workflow will Build image and push to mcad quay repository and create a GitHub release tag
name: mcad Release
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag'
required: true
default: 'v0.0.0-dev'
type: string
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: check tag format
run: |
if [[ "${{ github.event.inputs.tag }}" =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then
echo "Tag format is valid."
else
echo "Invalid tag format: ${{ github.event.inputs.tag }}"
exit 1
fi
- name: Create github release tag
run: |
if git rev-parse -q --verify "refs/tags/${{ github.event.inputs.tag }}"; then
echo "Tag ${{ github.event.inputs.tag }} already exist. Exiting workflow."
exit 1
else
gh release create ${{ github.event.inputs.tag }} --title "MCAD ${{ github.event.inputs.tag }} Release" --generate-notes --target ${{ github.ref }}
fi
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Publish MCAD package
run: |
GOPROXY=proxy.golang.org go list -m github.com/project-codeflare/multi-cluster-app-dispatcher@${{ github.event.inputs.tag }}