Feature/70 preview toggle editor link debugger #225
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
if: | | |
!startsWith(github.event.head_commit.message, 'chore: release v') | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "npm" | |
node-version: 18.15.0 | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
test: | |
name: Test | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "npm" | |
node-version: 18.15.0 | |
- name: Install dependencies | |
run: npm ci && node ./node_modules/puppeteer/install.js | |
- name: Test | |
run: npm run test:ci | |
build: | |
name: Build | |
needs: [lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "npm" | |
node-version: 18.15.0 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Docs | |
if: github.event_name == 'pull_request' | |
run: npm run docs | |
- name: Upload | |
if: github.event_name == 'pull_request' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: preview | |
path: dist | |
deploy-pr: | |
if: github.event_name == 'pull_request' | |
name: Deploy PR | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: Review | |
url: https://webcomponents-preview.github.io/client/pr/${{ github.event.number }}/ | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: deploy | |
token: ${{secrets.WCP_GITHUB_TOKEN}} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: preview | |
path: .tmp | |
- name: Configure git | |
run: | | |
git config user.name "autoreleaser" | |
git config user.email "release@enke.dev" | |
- name: Update latest | |
run: | | |
rm -rf pr/${{ github.event.number }} | |
mkdir -p pr | |
mv .tmp pr/${{ github.event.number }} | |
git add . | |
git commit --allow-empty --message $GITHUB_SHA | |
git push | |
release: | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{secrets.WCP_GITHUB_TOKEN}} | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "npm" | |
node-version: 18.15.0 | |
registry-url: https://registry.npmjs.org/ | |
- name: Configure git | |
run: | | |
git config user.name "autoreleaser" | |
git config user.email "release@enke.dev" | |
- name: Configure npm | |
run: npm config set //registry.npmjs.org/:_authToken ${{secrets.WCP_NPM_TOKEN}} | |
- name: Release | |
run: | | |
npx --package release-it --package @release-it/conventional-changelog release-it \ | |
--ci \ | |
--npm.skipChecks \ | |
--no-npm.publish \ | |
--github.release \ | |
--github.autoGenerate \ | |
--git.commitMessage='chore: release v${version}' \ | |
--git.pushArgs=--follow-tags \ | |
--plugins.@release-it/conventional-changelog.infile=CHANGELOG.md \ | |
--plugins.@release-it/conventional-changelog.header='# <img align="left" src="https://github.com/webcomponents-preview/client/raw/main/src/assets/icons/logo.svg" alt="WCP Logo" height="43px"> Web Components Preview' \ | |
--plugins.@release-it/conventional-changelog.preset=angular | |
env: | |
GITHUB_TOKEN: ${{secrets.WCP_GITHUB_TOKEN}} | |
NODE_AUTH_TOKEN: ${{secrets.WCP_NPM_TOKEN}} |