2023-11-03 05:04:12 +13:00
|
|
|
name: Release
|
2023-06-01 00:36:43 +12:00
|
|
|
concurrency:
|
|
|
|
group: tag-release
|
|
|
|
cancel-in-progress: false
|
2023-04-22 04:29:04 +12:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
versioning:
|
|
|
|
type: choice
|
|
|
|
description: "Versioning type: patch, minor, major"
|
|
|
|
default: patch
|
|
|
|
options:
|
|
|
|
- patch
|
|
|
|
- minor
|
|
|
|
- major
|
|
|
|
required: true
|
|
|
|
|
|
|
|
jobs:
|
2023-06-06 18:42:33 +12:00
|
|
|
tag-release:
|
2023-04-22 04:29:04 +12:00
|
|
|
runs-on: ubuntu-latest
|
2023-11-03 05:04:12 +13:00
|
|
|
outputs:
|
|
|
|
version: ${{ steps.tag-release.outputs.version }}
|
2023-04-22 04:29:04 +12:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Fail if branch is not master
|
|
|
|
if: github.ref != 'refs/heads/master'
|
|
|
|
run: |
|
|
|
|
echo "Ref is not master, you must run this job from master."
|
|
|
|
exit 1
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
|
|
|
|
2023-06-26 22:55:44 +12:00
|
|
|
- run: cd scripts && yarn
|
2023-06-06 18:42:33 +12:00
|
|
|
- name: Tag release
|
2023-11-03 05:04:12 +13:00
|
|
|
id: tag-release
|
2023-04-22 04:29:04 +12:00
|
|
|
run: |
|
2023-06-26 22:55:44 +12:00
|
|
|
cd scripts
|
2023-04-22 04:29:04 +12:00
|
|
|
# setup the username and email.
|
|
|
|
git config --global user.name "Budibase Staging Release Bot"
|
|
|
|
git config --global user.email "<>"
|
2023-06-06 19:52:32 +12:00
|
|
|
BUMP_TYPE_INPUT=${{ github.event.inputs.versioning }}
|
|
|
|
BUMP_TYPE=${BUMP_TYPE_INPUT:-"patch"}
|
2023-06-26 22:55:44 +12:00
|
|
|
./versionCommit.sh $BUMP_TYPE
|
2023-11-03 05:04:12 +13:00
|
|
|
|
2023-11-08 01:55:34 +13:00
|
|
|
cd ..
|
|
|
|
new_version=$(./scripts/getCurrentVersion.sh)
|
2023-11-03 05:04:12 +13:00
|
|
|
echo "version=$new_version" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
trigger-release:
|
|
|
|
needs: [tag-release]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: peter-evans/repository-dispatch@v2
|
|
|
|
with:
|
|
|
|
repository: budibase/budibase-deploys
|
2023-11-07 02:14:49 +13:00
|
|
|
event-type: release-prod
|
|
|
|
token: ${{ secrets.GH_ACCESS_TOKEN }}
|
2023-11-03 05:04:12 +13:00
|
|
|
client-payload: |-
|
|
|
|
{
|
|
|
|
"TAG": "${{ needs.tag-release.outputs.version }}"
|
|
|
|
}
|