2021-07-23 17:19:43 +02:00
|
|
|
name: Budibase Release Staging
|
2021-07-22 18:21:12 +02:00
|
|
|
|
2022-02-15 14:24:06 +01:00
|
|
|
on:
|
|
|
|
push:
|
2021-07-22 18:21:12 +02:00
|
|
|
branches:
|
|
|
|
- develop
|
2022-04-20 17:11:06 +02:00
|
|
|
- feature/licensing
|
2021-12-31 14:59:48 +01:00
|
|
|
paths:
|
2022-02-15 14:24:06 +01:00
|
|
|
- '.aws/**'
|
|
|
|
- '.github/**'
|
|
|
|
- 'charts/**'
|
|
|
|
- 'packages/**'
|
|
|
|
- 'scripts/**'
|
|
|
|
- 'package.json'
|
|
|
|
- 'yarn.lock'
|
|
|
|
- 'package.json'
|
|
|
|
- 'yarn.lock'
|
2021-07-22 18:21:12 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }}
|
2021-09-21 12:47:14 +02:00
|
|
|
INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }}
|
2021-07-22 18:21:12 +02:00
|
|
|
POSTHOG_URL: ${{ secrets.POSTHOG_URL }}
|
2022-02-15 14:24:06 +01:00
|
|
|
|
2021-07-22 18:21:12 +02:00
|
|
|
jobs:
|
|
|
|
release:
|
2022-02-15 14:24:06 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-07-22 18:21:12 +02:00
|
|
|
|
|
|
|
steps:
|
2022-04-20 18:12:40 +02:00
|
|
|
- name: Extract branch name
|
|
|
|
shell: bash
|
|
|
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF_NAME})"
|
|
|
|
id: extract_branch
|
|
|
|
|
2021-07-22 18:21:12 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
2021-11-18 11:59:35 +01:00
|
|
|
node-version: 14.x
|
2022-04-20 17:11:06 +02:00
|
|
|
|
|
|
|
# Add @budibase/pro to filesystem
|
|
|
|
- name: Checkout pro
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: budibase/budibase-pro
|
2022-04-20 18:12:40 +02:00
|
|
|
ref: ${{ steps.extract_branch.outputs.branch }}
|
2022-04-20 17:11:06 +02:00
|
|
|
path: './pro'
|
|
|
|
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
|
|
|
- name: Setup pro
|
|
|
|
run: mv pro ../budibase-pro && cd ../budibase-pro && yarn setup
|
|
|
|
|
2022-02-15 14:24:06 +01:00
|
|
|
- run: yarn
|
|
|
|
- run: yarn bootstrap
|
|
|
|
- run: yarn lint
|
|
|
|
- run: yarn build
|
2021-07-22 18:21:12 +02:00
|
|
|
- run: yarn test
|
|
|
|
|
|
|
|
- name: Configure AWS Credentials
|
|
|
|
uses: aws-actions/configure-aws-credentials@v1
|
|
|
|
with:
|
|
|
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
aws-region: eu-west-1
|
|
|
|
|
2022-04-20 21:32:00 +02:00
|
|
|
- name: Publish budibase packages to NPM
|
|
|
|
env:
|
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
run: |
|
|
|
|
# setup the username and email.
|
2022-04-20 21:59:37 +02:00
|
|
|
git config --global user.name "Budibase Staging Release Bot"
|
|
|
|
git config --global user.email "<>"
|
2022-04-20 21:32:00 +02:00
|
|
|
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc
|
|
|
|
# yarn release:develop
|
2022-04-20 17:11:06 +02:00
|
|
|
|
2022-04-20 18:30:42 +02:00
|
|
|
- name: Get the latest budibase release version
|
|
|
|
id: version
|
|
|
|
run: |
|
|
|
|
release_version=$(cat lerna.json | jq -r '.version')
|
|
|
|
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
2022-04-20 17:11:06 +02:00
|
|
|
|
|
|
|
- name: Publish @budibase/pro package to NPM
|
2021-07-22 18:21:12 +02:00
|
|
|
env:
|
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2022-04-20 17:11:06 +02:00
|
|
|
VERSION: ${{ steps.previoustag.outputs.tag }}
|
2022-02-15 14:24:06 +01:00
|
|
|
run: |
|
2022-04-20 21:58:57 +02:00
|
|
|
cd ../budibase-pro
|
2021-07-22 18:21:12 +02:00
|
|
|
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc
|
2022-04-20 18:30:42 +02:00
|
|
|
yarn release:develop $RELEASE_VERSION
|
2021-07-22 18:21:12 +02:00
|
|
|
|
2022-04-20 17:11:06 +02:00
|
|
|
# - name: Build/release Docker images
|
|
|
|
# run: |
|
|
|
|
# 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 }}
|