2021-12-16 11:55:32 +01:00
|
|
|
name: Budibase Release Selfhost
|
2021-10-08 11:37:08 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2022-08-10 14:57:33 +02:00
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: Budibase release version. For example - 1.0.0
|
|
|
|
required: false
|
2021-10-08 11:37:08 +02:00
|
|
|
|
2022-08-08 15:14:35 +02:00
|
|
|
env:
|
|
|
|
BRANCH: ${{ github.event.pull_request.head.ref }}
|
|
|
|
BASE_BRANCH: ${{ github.event.pull_request.base.ref}}
|
|
|
|
|
2021-10-08 11:37:08 +02:00
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-08-10 14:57:33 +02:00
|
|
|
- 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
|
|
|
|
|
2021-10-08 11:37:08 +02:00
|
|
|
- uses: actions/checkout@v2
|
2022-01-13 15:17:58 +01:00
|
|
|
with:
|
2022-01-13 15:31:17 +01:00
|
|
|
node-version: 14.x
|
2022-01-13 15:17:58 +01:00
|
|
|
fetch_depth: 0
|
2021-12-15 18:43:12 +01:00
|
|
|
|
2022-08-10 14:57:33 +02:00
|
|
|
- name: Get the latest budibase release version
|
|
|
|
id: version
|
|
|
|
run: |
|
|
|
|
if [ -z "${{ github.event.inputs.version }}" ]; then
|
|
|
|
release_version=$(cat lerna.json | jq -r '.version')
|
|
|
|
else
|
|
|
|
release_version=${{ github.event.inputs.version }}
|
|
|
|
fi
|
|
|
|
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
|
|
|
|
2022-08-10 15:07:21 +02:00
|
|
|
- name: Checkout tag
|
|
|
|
run: git checkout v${{ env.RELEASE_VERSION }}
|
|
|
|
|
2021-12-15 18:43:12 +01:00
|
|
|
- name: Tag and release Docker images (Self Host)
|
2022-01-13 15:17:58 +01:00
|
|
|
run: |
|
2021-10-08 11:37:08 +02:00
|
|
|
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
|
2021-12-15 18:43:12 +01:00
|
|
|
|
2022-08-10 14:57:33 +02:00
|
|
|
release_tag=v${{ env.RELEASE_VERSION }}
|
2021-12-15 18:43:12 +01:00
|
|
|
|
|
|
|
# Pull apps and worker images
|
2021-12-15 19:40:59 +01:00
|
|
|
docker pull budibase/apps:$release_tag
|
|
|
|
docker pull budibase/worker:$release_tag
|
2022-02-12 12:53:26 +01:00
|
|
|
docker pull budibase/proxy:$release_tag
|
2021-12-15 18:43:12 +01:00
|
|
|
|
|
|
|
# Tag apps and worker images
|
2021-12-16 13:01:43 +01:00
|
|
|
docker tag budibase/apps:$release_tag budibase/apps:$SELFHOST_TAG
|
|
|
|
docker tag budibase/worker:$release_tag budibase/worker:$SELFHOST_TAG
|
2022-02-11 19:40:28 +01:00
|
|
|
docker tag budibase/proxy:$release_tag budibase/proxy:$SELFHOST_TAG
|
2022-01-13 15:17:58 +01:00
|
|
|
|
2021-12-15 18:43:12 +01:00
|
|
|
# Push images
|
2021-12-16 13:01:43 +01:00
|
|
|
docker push budibase/apps:$SELFHOST_TAG
|
|
|
|
docker push budibase/worker:$SELFHOST_TAG
|
2022-02-11 19:40:28 +01:00
|
|
|
docker push budibase/proxy:$SELFHOST_TAG
|
2021-10-08 11:37:08 +02:00
|
|
|
env:
|
|
|
|
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }}
|
2021-12-16 13:01:43 +01:00
|
|
|
SELFHOST_TAG: latest
|
2022-08-08 15:14:35 +02:00
|
|
|
|
|
|
|
- name: Install Pro
|
|
|
|
run: yarn install:pro $BRANCH $BASE_BRANCH
|
|
|
|
|
|
|
|
- name: Bootstrap and build (CLI)
|
2022-01-13 15:31:17 +01:00
|
|
|
run: |
|
|
|
|
yarn
|
2022-08-08 15:14:35 +02:00
|
|
|
yarn bootstrap
|
2022-01-13 15:31:17 +01:00
|
|
|
yarn build
|
2022-02-28 14:25:09 +01:00
|
|
|
|
2022-03-10 12:08:02 +01:00
|
|
|
- name: Build OpenAPI spec
|
2022-02-28 14:25:09 +01:00
|
|
|
run: |
|
|
|
|
pushd packages/server
|
|
|
|
yarn
|
2022-03-10 12:17:15 +01:00
|
|
|
yarn specs
|
2022-02-28 14:25:09 +01:00
|
|
|
popd
|
2022-01-13 15:31:17 +01:00
|
|
|
|
2022-01-13 15:17:58 +01:00
|
|
|
- name: Setup Helm
|
2021-12-15 19:46:28 +01:00
|
|
|
uses: azure/setup-helm@v1
|
|
|
|
id: helm-install
|
2021-12-16 14:31:40 +01:00
|
|
|
|
2021-12-21 16:05:43 +01:00
|
|
|
- name: Build and release helm chart
|
|
|
|
run: |
|
|
|
|
git config user.name "Budibase Helm Bot"
|
|
|
|
git config user.email "<>"
|
2022-03-14 16:53:24 +01:00
|
|
|
git reset --hard
|
2021-12-21 16:05:43 +01:00
|
|
|
git pull
|
2021-12-21 16:12:28 +01:00
|
|
|
helm package charts/budibase
|
2021-12-21 16:39:40 +01:00
|
|
|
git checkout gh-pages
|
2021-12-21 16:26:49 +01:00
|
|
|
mv *.tgz docs
|
2021-12-21 16:05:43 +01:00
|
|
|
helm repo index docs
|
|
|
|
git add -A
|
|
|
|
git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}"
|
|
|
|
git push
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-12-16 19:24:07 +01:00
|
|
|
|
2021-12-16 13:38:21 +01:00
|
|
|
- name: Perform Github Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2021-12-16 16:04:08 +01:00
|
|
|
name: v${{ env.RELEASE_VERSION }}
|
2021-12-17 14:58:03 +01:00
|
|
|
tag_name: v${{ env.RELEASE_VERSION }}
|
2022-01-13 15:31:17 +01:00
|
|
|
generate_release_notes: true
|
|
|
|
files: |
|
|
|
|
packages/cli/build/cli-win.exe
|
|
|
|
packages/cli/build/cli-linux
|
2022-02-11 19:40:28 +01:00
|
|
|
packages/cli/build/cli-macos
|
2022-02-28 14:25:09 +01:00
|
|
|
packages/server/specs/openapi.yaml
|
|
|
|
packages/server/specs/openapi.json
|
2022-05-13 10:59:40 +02:00
|
|
|
|
|
|
|
- name: Discord Webhook Action
|
|
|
|
uses: tsickert/discord-webhook@v4.0.0
|
|
|
|
with:
|
|
|
|
webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }}
|
|
|
|
content: "Self Host Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Self Host."
|
2022-08-08 15:14:35 +02:00
|
|
|
embed-title: ${{ env.RELEASE_VERSION }}
|