2022-06-21 00:27:03 +12:00
|
|
|
name: Budibase Prerelease
|
2022-12-20 05:03:07 +13:00
|
|
|
concurrency: release-prerelease
|
2021-07-23 04:21:12 +12:00
|
|
|
|
2023-04-12 04:16:04 +12:00
|
|
|
on:
|
|
|
|
push:
|
2021-07-23 04:21:12 +12:00
|
|
|
branches:
|
2022-06-20 21:40:05 +12:00
|
|
|
- develop
|
2022-01-01 02:59:48 +13:00
|
|
|
paths:
|
2023-04-12 04:16:04 +12:00
|
|
|
- ".aws/**"
|
|
|
|
- ".github/**"
|
|
|
|
- "charts/**"
|
|
|
|
- "packages/**"
|
|
|
|
- "scripts/**"
|
|
|
|
- "package.json"
|
|
|
|
- "yarn.lock"
|
|
|
|
- "package.json"
|
|
|
|
- "yarn.lock"
|
|
|
|
workflow_dispatch:
|
2021-07-23 04:21:12 +12:00
|
|
|
|
|
|
|
env:
|
2022-08-08 22:51:38 +12:00
|
|
|
# Posthog token used by ui at build time
|
|
|
|
# disable unless needed for testing
|
|
|
|
# POSTHOG_TOKEN: phc_uDYOfnFt6wAbBAXkC6STjcrTpAFiWIhqgFcsC1UVO5F
|
2021-09-21 22:47:14 +12:00
|
|
|
INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }}
|
2022-06-29 09:45:05 +12:00
|
|
|
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
2022-06-29 05:07:43 +12:00
|
|
|
FEATURE_PREVIEW_URL: https://budirelease.live
|
2023-04-12 04:16:04 +12:00
|
|
|
|
2021-07-23 04:21:12 +12:00
|
|
|
jobs:
|
2022-12-20 05:01:12 +13:00
|
|
|
release-images:
|
2023-04-12 04:16:04 +12:00
|
|
|
runs-on: ubuntu-latest
|
2021-07-23 04:21:12 +12:00
|
|
|
|
|
|
|
steps:
|
2022-06-20 21:40:05 +12:00
|
|
|
- name: Fail if branch is not develop
|
2023-04-12 04:16:04 +12:00
|
|
|
if: github.ref != 'refs/heads/develop'
|
|
|
|
run: |
|
2022-06-20 21:40:05 +12:00
|
|
|
echo "Ref is not develop, you must run this job from develop."
|
|
|
|
exit 1
|
2021-07-23 04:21:12 +12:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
2021-11-18 23:59:35 +13:00
|
|
|
node-version: 14.x
|
2022-04-21 03:11:06 +12:00
|
|
|
|
2023-04-12 04:16:04 +12:00
|
|
|
- run: yarn
|
2022-12-20 05:01:12 +13:00
|
|
|
- run: yarn bootstrap
|
2022-09-21 20:09:12 +12:00
|
|
|
- run: yarn build
|
|
|
|
- run: yarn build:sdk
|
2023-04-12 04:16:04 +12:00
|
|
|
# - run: yarn test
|
2021-07-23 04:21:12 +12:00
|
|
|
|
2022-04-21 07:32:00 +12:00
|
|
|
- name: Publish budibase packages to NPM
|
|
|
|
env:
|
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2023-04-12 04:16:04 +12:00
|
|
|
run: |
|
2022-04-21 07:32:00 +12:00
|
|
|
# setup the username and email.
|
2022-04-21 07:59:37 +12:00
|
|
|
git config --global user.name "Budibase Staging Release Bot"
|
|
|
|
git config --global user.email "<>"
|
2022-04-21 07:32:00 +12:00
|
|
|
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc
|
2022-04-21 08:25:12 +12:00
|
|
|
yarn release:develop
|
2022-04-21 03:11:06 +12:00
|
|
|
|
2022-04-21 08:25:12 +12:00
|
|
|
- name: Build/release Docker images
|
2023-04-12 04:16:04 +12:00
|
|
|
run: |
|
2022-04-21 08:25:12 +12:00
|
|
|
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
|
|
|
|
yarn build
|
|
|
|
yarn build:docker:develop
|
|
|
|
env:
|
|
|
|
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }}
|
2022-05-27 00:58:17 +12:00
|
|
|
|
2022-12-20 05:01:12 +13:00
|
|
|
release-helm-chart:
|
|
|
|
needs: [release-images]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Helm
|
|
|
|
uses: azure/setup-helm@v1
|
|
|
|
id: helm-install
|
|
|
|
|
|
|
|
# due to helm repo index issue: https://github.com/helm/helm/issues/7363
|
|
|
|
# we need to create new package in a different dir, merge the index and move the package back
|
|
|
|
- name: Build and release helm chart
|
|
|
|
run: |
|
|
|
|
git config user.name "Budibase Helm Bot"
|
|
|
|
git config user.email "<>"
|
|
|
|
git reset --hard
|
|
|
|
git pull
|
|
|
|
mkdir sync
|
|
|
|
echo "Packaging chart to sync dir"
|
|
|
|
helm package charts/budibase --version 0.0.0-develop --app-version develop --destination sync
|
|
|
|
echo "Packaging successful"
|
|
|
|
git checkout gh-pages
|
|
|
|
echo "Indexing helm repo"
|
|
|
|
helm repo index --merge docs/index.yaml sync
|
|
|
|
mv -f sync/* docs
|
|
|
|
rm -rf sync
|
|
|
|
echo "Pushing new helm release"
|
|
|
|
git add -A
|
|
|
|
git commit -m "Helm Release: develop"
|
|
|
|
git push
|
|
|
|
|
2022-12-20 05:04:58 +13:00
|
|
|
trigger-deploy-to-qa-env:
|
2022-12-20 05:01:12 +13:00
|
|
|
needs: [release-helm-chart]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-12-21 05:10:02 +13:00
|
|
|
- uses: actions/checkout@v2
|
2022-12-20 05:01:12 +13:00
|
|
|
- name: Get the current budibase release version
|
|
|
|
id: version
|
|
|
|
run: |
|
|
|
|
release_version=$(cat lerna.json | jq -r '.version')
|
|
|
|
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- uses: passeidireto/trigger-external-workflow-action@main
|
|
|
|
env:
|
|
|
|
PAYLOAD_VERSION: ${{ env.RELEASE_VERSION }}
|
|
|
|
with:
|
|
|
|
repository: budibase/budibase-deploys
|
2023-02-17 21:25:10 +13:00
|
|
|
event: budicloud-qa-deploy
|
2023-03-08 02:34:18 +13:00
|
|
|
github_pat: ${{ secrets.GH_ACCESS_TOKEN }}
|