chore: release v0.8.3 #291
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 | |
permissions: | |
checks: write | |
pull-requests: write | |
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: 20.10.0 | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint:ci | |
- uses: enricomi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
check_name: Lint results | |
fail_on: errors | |
files: reports/lint-results.xml | |
test: | |
name: Test | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "npm" | |
node-version: 20.10.0 | |
- name: Install dependencies | |
run: npm ci && node ./node_modules/puppeteer/install.mjs | |
- name: Test | |
run: npm run test:ci | |
- uses: enricomi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
check_name: Test results | |
fail_on: errors | |
files: reports/test-results.xml | |
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: 20.10.0 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Docs | |
if: github.event_name == 'pull_request' | |
run: npm run generate: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: 20.10.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}} |