-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (65 loc) · 2.22 KB
/
fully-automated-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
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
# this action is triggered by selecting the action in the github UI and then clicking "run workflow"
name: Fully automated release
on:
workflow_dispatch:
inputs:
promotiontype:
description: Promotion type (major, minor, patch)
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch
jobs:
archiveInput:
runs-on: ubuntu-latest
steps:
- run: echo ${{ github.event.inputs.promotiontype }} >> promotiontype.txt
- name: Archive type
uses: actions/upload-artifact@v4
with:
name: promotiontype
retention-days: 1
path: |
./promotiontype.txt
updateAndCreatePR:
env:
GOFLAGS: "-mod=mod"
GOWORK: "off"
defaults:
run:
working-directory: .
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Get latest SDK version
run: |
export LATEST_REMOTE_TAG_CMD="git ls-remote --tags --refs --sort='version:refname' REMOTE_REPO | grep -Eo 'v?[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$' | tail -1"
REMOTE_REPO_PATH="https://github.com/Axway/agent-sdk"
CMD=${LATEST_REMOTE_TAG_CMD/"REMOTE_REPO"/${REMOTE_REPO_PATH}}
export SDK_VERSION=$(eval $CMD)
echo "SDK_VERSION=${SDK_VERSION}" >> $GITHUB_ENV
- name: Update SDK version in go.mod
working-directory: .
run: |
echo "SDK_VERSION is ${{ env.SDK_VERSION }}"
make dep-version sdk=${{ env.SDK_VERSION }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
branch: APIGOV-UpdateSDKForRelease
commit-message: 'Update to SDK ${{ env.SDK_VERSION }}'
title: 'APIGOV-UpdateSDKForRelease - Update to SDK ${{ env.SDK_VERSION }}'
delete-branch: true
reviewers: dfeldick
- name: Enable Pull Request Automerge
run: gh pr merge APIGOV-UpdateSDKForRelease --admin --merge --subject "Merge branch APIGOV-UpdateSDKForRelease"
env:
GH_TOKEN: ${{ secrets.ACTION_ACCESS_TOKEN }}