From a1294e328bcbacbbb352889fdb7379ff37c595d4 Mon Sep 17 00:00:00 2001 From: "[ Cassondra ]" Date: Wed, 29 May 2024 17:36:57 -0400 Subject: [PATCH] chore: adjust release settings --- .github/workflows/build.yml | 50 ++------------------------- .github/workflows/publish.yml | 65 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 10 +++--- package.json | 10 +----- 4 files changed, 74 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13e8ca7d..441c541c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,22 +10,18 @@ name: Verify on: merge_group: workflow_dispatch: + push: + branches: + - main pull_request: branches: - main - types: - opened - synchronize - reopened - auto_merge_enabled -permissions: - contents: read - pull-requests: write - pages: write - id-token: write - concurrency: group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" cancel-in-progress: true @@ -84,43 +80,3 @@ jobs: git diff > changes.diff exit 1 fi - - # ------------------------------------------------------------- - # PUBLISH PR PREVIEW --- # - # ------------------------------------------------------------- - publish_site: - name: Publish preview - if: ${{ github.event.pull_request.draft != 'true' || contains(github.event.pull_request.labels.*.name, 'run_ci') }} - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Use Node LTS version - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: yarn - - - name: Install dependencies - shell: bash - run: yarn install --frozen-lockfile - - - name: Build site - shell: bash - run: yarn site - - ## --- DEPLOY WEBSITE TO NETLIFY --- ## - - name: Deploy - uses: nwtgck/actions-netlify@v3 - with: - publish-dir: dist - production-branch: main - production-deploy: false - netlify-config-path: ./netlify.toml - github-token: ${{ secrets.GITHUB_TOKEN }} - deploy-message: ${{ github.event.pull_request.title }} - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN_GH_ACTIONS_DEPLOY }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - timeout-minutes: 10 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..e1b5b737 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,65 @@ +name: Verify + # ------------------------------------------------------------- + # This workflow will build and verify pull requests. It will: + # - Build the base branch and the PR branch + # - Compare the compiled output of the two branches + # - Run visual regression tests on the PR branch + # - Publish the PR branch for review + # ------------------------------------------------------------- + +on: + push: + branches: + - main + pull_request: + branches: + - main + types: + - opened + - synchronize + - reopened + - auto_merge_enabled + +defaults: + run: + shell: bash + +jobs: + # ------------------------------------------------------------- + # PUBLISH PR PREVIEW --- # + # ------------------------------------------------------------- + publish_site: + name: Publish preview + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Use Node LTS version + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + + - name: Install dependencies + shell: bash + run: yarn install --frozen-lockfile + + - name: Build site + shell: bash + run: yarn site + + ## --- DEPLOY WEBSITE TO NETLIFY --- ## + - name: Deploy + uses: nwtgck/actions-netlify@v3 + with: + publish-dir: dist + production-branch: main + production-deploy: false + netlify-config-path: ./netlify.toml + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: ${{ github.event.pull_request.title }} + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN_GH_ACTIONS_DEPLOY }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 10 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b31862c2..96199adc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,8 +5,11 @@ on: branches: - main -permissions: - contents: read +concurrency: ${{ github.workflow }}-${{ github.ref }} + +defaults: + run: + shell: bash jobs: release: @@ -26,18 +29,15 @@ jobs: scope: '@adobe' - name: Install dependencies - shell: bash run: yarn install --frozen-lockfile - name: Create release pull request or publish to npm id: changesets uses: changesets/action@v1 with: - # This expects you to have a script called release which does a build for your packages and calls changeset publish title: "chore: release" commit: "chore: release" publish: yarn release - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} diff --git a/package.json b/package.json index b4f2a381..cc44a676 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "site": "eleventy", "clean": "rimraf dist _site", "serve": "eleventy --serve", - "release": "yarn build && changeset publish" + "release": "yarn clean && yarn build && changeset publish" }, "devDependencies": { "@11ty/eleventy": "^3.0.0-alpha.10", @@ -48,14 +48,6 @@ "rimraf": "^5.0.5", "rollup": "^4.17.2" }, - "peerDependencies": { - "@a4u/a4u-s2-icon-global-set-open-source-processed": "2.0.0" - }, - "peerDependenciesMeta": { - "@a4u/a4u-s2-icon-global-set-open-source-processed": { - "optional": true - } - }, "engines": { "node": ">=20" },