Skip to content

Commit

Permalink
chore: adjust release settings
Browse files Browse the repository at this point in the history
  • Loading branch information
castastrophe committed May 29, 2024
1 parent e75b6c7 commit a1294e3
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 61 deletions.
50 changes: 3 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
65 changes: 65 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ on:
branches:
- main

permissions:
contents: read
concurrency: ${{ github.workflow }}-${{ github.ref }}

defaults:
run:
shell: bash

jobs:
release:
Expand All @@ -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 }}
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down

1 comment on commit a1294e3

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.