diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 3bf3d437..1c24f0a7 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -8,7 +8,7 @@ on: env: RUBY_VERSION: 3.0.3 - NODE_VERSION: 19.4.0 + NODE_VERSION: 20.11.0 jobs: build-documentation: diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 5f8ec794..79cfeccc 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -6,7 +6,7 @@ on: env: RUBY_VERSION: 3.0.3 - NODE_VERSION: 16.19.0 + NODE_VERSION: 20.11.0 jobs: release: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..493d7efd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Create version packages PR or release + +on: + release: + types: [published] + workflow_dispatch: # Allow manual triggering of the workflow + inputs: + tag: + description: 'Tag to release' + required: true + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + id-token: write + steps: + - name: Set tag name + id: set-tag + run: echo "TAG_NAME=${{ github.event.release.tag_name || github.event.inputs.tag }}" >> $GITHUB_ENV + + - name: Checkout Repo + uses: actions/checkout@v3 + with: + token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} + # Use the tag associated with the release + ref: ${{ env.TAG_NAME }} + + - name: Setup Node from .nvmrc + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Publish to NPM + run: npm publish --provenance --tag ${{ env.TAG_NAME }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} diff --git a/.github/workflows/restyle.yml b/.github/workflows/restyle.yml index 79cbb56c..7a856000 100644 --- a/.github/workflows/restyle.yml +++ b/.github/workflows/restyle.yml @@ -8,7 +8,7 @@ on: env: RUBY_VERSION: 3.0.3 - NODE_VERSION: 19.1.0 + NODE_VERSION: 20.11.0 jobs: build-ts: diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..8b0beab1 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.11.0 diff --git a/RELEASE.md b/RELEASE.md index 245c0f3a..5389827b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,4 +4,4 @@ 2. Run `yarn version` and follow the prompts to choose a version for the package. 3. Update the Changelog to place all Next items under the new version. 4. Push the changes and new tags to GitHub with `git push origin master --follow-tags`. -5. Publish the release on the internal package registry by triggering a deploy on [Shipit](https://shipit.shopify.io/shopify/restyle). +5. Publish the release on [Github Releases](https://github.com/Shopify/restyle/releases) and the package should be automatically published by Github Actions