From 1bcb481d69c0cc91ffa6532689e1400c8eaa8eaf Mon Sep 17 00:00:00 2001 From: adrinr Date: Thu, 20 Apr 2023 12:50:26 +0100 Subject: [PATCH] Change publish process --- .github/workflows/release-develop.yml | 27 +++++++++++++++++++-------- package.json | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 07ff0b20c7..cf5e0e6b9f 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -3,8 +3,8 @@ concurrency: release-prerelease on: push: - branches: - - develop + tags: + - v*-alpha.* paths: - ".aws/**" - ".github/**" @@ -30,24 +30,35 @@ jobs: runs-on: ubuntu-latest steps: - - name: Fail if branch is not develop - if: github.ref != 'refs/heads/develop' - run: | - echo "Ref is not develop, you must run this job from develop." - exit 1 - uses: actions/checkout@v2 with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + fetch-depth: 1 + + - name: Fail if tag is not develop + run: | + if ! git merge-base --is-ancestor ${{ github.sha }} origin/develop; then + echo "Tag is not in develop" + exit 1 + fi + - uses: actions/setup-node@v1 with: node-version: 14.x - run: yarn + - name: Update versions + run: | + version=$(cat versions/package.json \ + | grep version \ + | head -1 \ + | awk -F: '{ print $2 }' \ + | sed 's/[",]//g') + yarn lerna exec "yarn version --no-git-tag-version --new-version=$tag" - run: yarn bootstrap - run: yarn build - run: yarn build:sdk - # - run: yarn test - name: Publish budibase packages to NPM env: diff --git a/package.json b/package.json index 1c9dfa9205..9f8bb7113c 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "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:develop": "lerna publish prerelease --yes --force-publish --dist-tag develop --exact", + "release:develop": "npm publish", "restore": "yarn run clean && yarn run bootstrap && yarn run build", "nuke": "yarn run nuke:packages && yarn run nuke:docker", "nuke:packages": "yarn run restore",