diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index ebf3cb007e..eecda4d926 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -65,11 +65,10 @@ jobs: # setup the username and email. git config --global user.name "Budibase Staging Release Bot" git config --global user.email "<>" - git submodule foreach git commit -a -m 'release process' - git commit -a -m 'release process' + git submodule foreach git commit -a -m 'Release process' + git commit -a -m 'Release process' echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc yarn release:develop - echo 'Done' - name: Build/release Docker images run: | diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index e88fbbf0b8..cd0f3d40d7 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -3,29 +3,16 @@ concurrency: release on: push: - branches: - - master - paths: - - ".aws/**" - - ".github/**" - - "charts/**" - - "packages/**" - - "scripts/**" - - "package.json" - - "yarn.lock" - - "package.json" - - "yarn.lock" + tags: + - v* + tags-ignore: + - v*-alpha.* workflow_dispatch: inputs: - versioning: - type: choice - description: "Versioning type: patch, minor, major" - default: patch - options: - - patch - - minor - - major + tags: + description: "Release tag" required: true + type: boolean env: # Posthog token used by ui at build time @@ -38,20 +25,34 @@ jobs: release-images: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 + with: + submodules: true + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + fetch-depth: 1 + - 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 }} + - uses: actions/setup-node@v1 with: node-version: 14.x - run: yarn + - name: Update versions + run: | + version=$(cat lerna.json \ + | grep version \ + | head -1 \ + | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ + | sed 's/[",]//g') + echo "Setting version $version" + yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" + node scripts/updateVersions.js $version + yarn - run: yarn bootstrap - run: yarn lint - run: yarn build @@ -65,6 +66,8 @@ jobs: # setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default git config --global user.name "Budibase Release Bot" git config --global user.email "<>" + git submodule foreach git commit -a -m 'Release process' + git commit -a -m 'Release process' echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc yarn release @@ -104,7 +107,7 @@ jobs: git config user.name "Budibase Helm Bot" git config user.email "<>" git reset --hard - git pull + git fetch mkdir sync echo "Packaging chart to sync dir" helm package charts/budibase --version 0.0.0-master --app-version v"$RELEASE_VERSION" --destination sync diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml new file mode 100644 index 0000000000..da53612bd9 --- /dev/null +++ b/.github/workflows/tag-release.yml @@ -0,0 +1,48 @@ +name: Tag prerelease +concurrency: release-prerelease + +on: + push: + branches: + - master + paths: + - ".aws/**" + - ".github/**" + - "charts/**" + - "packages/**" + - "scripts/**" + - "package.json" + - "yarn.lock" + workflow_dispatch: + inputs: + versioning: + type: choice + description: "Versioning type: patch, minor, major" + default: patch + options: + - patch + - minor + - major + required: true + +jobs: + tag-prerelease: + runs-on: ubuntu-latest + + 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 }} + + - name: Tag prerelease + run: | + # setup the username and email. + git config --global user.name "Budibase Staging Release Bot" + git config --global user.email "<>" + ./scripts/versionCommit.sh ${{ github.event.inputs.versioning }} diff --git a/package.json b/package.json index 1e2fea88f3..742b65f90c 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "backend:build": "./scripts/scopeBackend.sh 'lerna run --stream build'", "build:sdk": "lerna run --stream build:sdk", "deps:circular": "madge packages/server/dist/index.js packages/worker/src/index.ts packages/backend-core/dist/src/index.js packages/cli/src/index.js --circular", - "release": "lerna publish ${RELEASE_VERSION_TYPE:-patch} --yes --force-publish", + "release": "lerna publish ${RELEASE_VERSION_TYPE:-patch} --yes --force-publish --no-git-tag-version --no-push --no-git-reset", "release:develop": "lerna publish from-package --yes --force-publish --dist-tag develop --exact --no-git-tag-version --no-push --no-git-reset", "restore": "yarn run clean && yarn run bootstrap && yarn run build", "nuke": "yarn run nuke:packages && yarn run nuke:docker",