Skip to content

Commit

Permalink
ci: Standardize github actions with my other repos
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Jan 22, 2024
1 parent f335db7 commit 795cb05
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 101 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/publish.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release
on:
workflow_dispatch:

jobs:
validate:
uses: './.github/workflows/validate.yml'

publish:
runs-on: ubuntu-22.04
needs:
- validate
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: ./.github/actions/setup

- name: Bump and Tag
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
pnpx changelogen@latest --release
git push
git push --tags
- name: NPM
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
pnpm publish
- name: GitHub Release
run: pnpx changelogen@latest gh release --token ${{ secrets.GITHUB_TOKEN }}
64 changes: 18 additions & 46 deletions .github/workflows/verify.yml → .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,41 @@
name: Verify
name: Validate
on: [push, workflow_call]

jobs:
verify:
name: Verify Code
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- uses: pnpm/[email protected]
name: Install PNPM
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8

- name: Install Node
uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Formatting
run: pnpm format:check

- name: Type Check
run: pnpm compile

- name: Build
run: pnpm build

- name: Lint
run: pnpm lint

- name: Test
run: pnpm test

- name: Check CLI
run: node bin/publish-extension.cjs --help
cache: pnpm
- run: pnpm install
- run: pnpm format:check
- run: pnpm compile
- run: pnpm build
- run: pnpm lint
- run: pnpm test
- run: node bin/publish-extension.cjs --help

e2e-test:
name: E2E Publish Test
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- uses: pnpm/[email protected]
name: Install PNPM
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8

- name: Install Node 16
uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Publish
run: ./scripts/dev.sh all
cache: pnpm
- run: pnpm install
- run: ./scripts/dev.sh all
env:
CHROME_EXTENSION_ID: ${{ secrets.TEST_CHROME_EXTENSION_ID }}
CHROME_CLIENT_ID: ${{ secrets.TEST_CHROME_CLIENT_ID }}
Expand Down

0 comments on commit 795cb05

Please sign in to comment.