forked from kubernetes-sigs/cluster-api-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.07 KB
/
release.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
name: release
on:
push:
tags:
- 'v*'
permissions:
contents: write # required to write to github release.
jobs:
release:
name: Create draft release
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Set version info
run: |
echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
echo "PREVIOUS_VERSION=$(git describe --abbrev=0 2> /dev/null)" >> $GITHUB_ENV
echo "RELEASE_BRANCH=release-$(echo ${GITHUB_REF_NAME} | grep -Eo '[0-9]\.[0-9]+')" >> $GITHUB_ENV
echo "RELEASE_TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Run release
run: |
echo "Version is: $VERSION"
echo "Previous version is: $PREVIOUS_VERSION"
echo "Release branch is: $RELEASE_BRANCH"
echo "Release tag is: $RELEASE_TAG"
make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}