This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APIGOV-25964 - test new release actions
- Loading branch information
Showing
3 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This action gets triggered by a closed PR on branch named 'APIGOV-UpdateSDK' | ||
name: Create tag for release | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
if_SDK_update_merged: | ||
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'APIGOV-UpdateSDK') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Bump tag version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
# by default, this action creates a tag with a 'v' prefix, and bumps the patch version. | ||
# See https://github.com/mathieudutour/github-tag-action to customize these rules. | ||
github_token: ${{ secrets.ACTION_ACCESS_TOKEN }} | ||
|
||
- name: Show the new tag | ||
run: | | ||
echo "previous tag ${{ steps.tag_version.outputs.previous_tag }} | ||
echo "new tag ${{ steps.tag_version.outputs.new_tag }} | ||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# this action is triggered by selecting the action in the github UI and then clicking "run workflow" | ||
name: Update SDK version for release | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
updateAndCreatePR: | ||
env: | ||
GOFLAGS: "-mod=mod" | ||
GOWORK: "off" | ||
defaults: | ||
run: | ||
working-directory: . | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
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,3}$' | 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=v1.1.61 | ||
- name: Create Pull Request | ||
id: cpr | ||
uses: peter-evans/[email protected] | ||
with: | ||
branch: APIGOV-UpdateSDK | ||
commit-message: 'Update to SDK ${{ env.SDK_VERSION }}' | ||
title: 'APIGOV-UpdateSDK - Update to SDK ${{ env.SDK_VERSION }}' | ||
delete-branch: true | ||
reviewers: dfeldick | ||
|
||
- name: Enable Pull Request Automerge | ||
run: gh pr merge APIGOV-UpdateSDK --admin --merge --subject "Merge branch APIGOV-UpdateSDK" | ||
env: | ||
GH_TOKEN: ${{ secrets.ACTION_ACCESS_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters