From f60267a494f95d85b6007e617a1f9b0146854bae Mon Sep 17 00:00:00 2001 From: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Date: Wed, 16 Nov 2022 20:08:18 +0100 Subject: [PATCH] feat(medusa): Release staging version on push to `develop` (#2594) * initial * working config * update name and add snapshot to release * add changeset * use correct command for action * pr feedback --- .changeset/cool-trains-relax.md | 5 ++++ .github/workflows/staging-release.yml | 34 ++++++++++++++++++++------- package.json | 3 ++- 3 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 .changeset/cool-trains-relax.md diff --git a/.changeset/cool-trains-relax.md b/.changeset/cool-trains-relax.md new file mode 100644 index 0000000000..62899fefde --- /dev/null +++ b/.changeset/cool-trains-relax.md @@ -0,0 +1,5 @@ +--- +"@medusajs/medusa": patch +--- + +Update staging action for automatic releases diff --git a/.github/workflows/staging-release.yml b/.github/workflows/staging-release.yml index 2c8a69966e..8b91a0ca2a 100644 --- a/.github/workflows/staging-release.yml +++ b/.github/workflows/staging-release.yml @@ -1,4 +1,4 @@ -name: Staging Release +name: Staging Release and Publish on: push: @@ -15,17 +15,35 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - - name: Setup Node.js 12.x + - name: Setup Node.js 16.x uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 16.x + + - name: Creating .npmrc + run: | + cat << EOF > "$HOME/.npmrc" + //registry.npmjs.org/:_authToken=$NPM_TOKEN + EOF + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Configure npm node prepend + run: npm config set scripts-prepend-node-path auto - name: Install Dependencies run: yarn - - name: Create Release Pull Request - uses: changesets/action@v1 - with: - version: yarn version:staging + - name: Build all packages + run: yarn build + + - name: Version staging packages + run: yarn version:staging env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Dependencies + run: yarn + + - name: Publish staging packages + run: yarn release:staging diff --git a/package.json b/package.json index b740fbe4ea..6bf7b951d7 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,8 @@ "generate:announcement": "node ./scripts/doc-change-release.js", "develop": "NODE_ENV=development ts-node --transpile-only ./integration-tests/development/server.js", "develop:create:db": "NODE_ENV=development ts-node --transpile-only ./integration-tests/development/create-database.js", - "version:staging": "yarn changeset pre enter staging && yarn changeset version", + "release:staging": "changeset publish --no-git-tags --snapshot --tag staging", + "version:staging": "changeset version --snapshot staging", "check:freshness": "node ./scripts/freshness-check.js" }, "dependencies": {