release #23
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
name: release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
release: | |
name: Create a github branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN }} | |
# Create actual release | |
- name: Get the branch version | |
id: get_branch | |
run: | | |
TNAME=${GITHUB_REF/refs\/tags\//} | |
if ${{github.event_name == 'workflow_dispatch'}}; then | |
TNAME=$(git describe --abbrev=0 --tags) | |
fi | |
echo ::set-output name=BRANCH::$(echo ${TNAME} | cut -d '.' -f1-2 | tr -d 'v') | |
echo ::set-output name=TAGNAME::$(echo ${TNAME} | cut -d '.' -f1-3) | |
- name: Create GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
bodyFile: notes/${{ steps.get_branch.outputs.TAGNAME }}.md | |
token: ${{ secrets.GH_TOKEN }} | |
tag: ${{ steps.get_branch.outputs.TAGNAME }} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.19 | |
id: go | |
- name: Bump main version | |
run: make patch | |
- name: Create a GitHub branch | |
uses: peterjgrainger/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
branch: ${{ steps.get_branch.outputs.BRANCH }} | |
- name: Commit changes to the minor branch | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: user_info | |
message: 'Update patch version' | |
branch: ${{ steps.get_branch.outputs.BRANCH }} | |
author_name: elasticcloudclients | |
author_email: [email protected] | |
bump-minor-version: | |
name: Bump main version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.19 | |
id: go | |
- name: Bump main version | |
run: make minor; git diff | |
- name: Commit changes to main | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: user_info | |
message: 'Update minor version' | |
branch: master | |
author_name: elasticcloudclients | |
author_email: [email protected] |