Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: workflow #43

Merged
merged 12 commits into from
Sep 13, 2023
7 changes: 3 additions & 4 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: 📥 Download deps
- name: 📥 Install deps
run: npm ci

- name: 🏗 Build
Expand All @@ -50,9 +50,8 @@ jobs:
dry_run: true
ci: false
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/changelog
@semantic-release/git
branches: |
[
'main',
Expand Down
46 changes: 13 additions & 33 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,36 @@ on:
push:
branches:
- main
- beta

jobs:
Test:
name: 🚨 Test 🚨
Publish:
name: 🚀 Publish 🚀
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [18]
os: [ubuntu-latest]

if: ${{ github.ref == 'refs/heads/main' }}

steps:
- uses: actions/checkout@v4
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "npm"

- run: npm install
- run: npm run build
- run: npm run format

Publish:
name: 🚀 Publish 🚀
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [18]
os: [ubuntu-latest]
if: ${{ github.ref == 'refs/heads/main' }}
needs: [Test]
steps:
- name: ⎔ Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
env:
HUSKY_SKIP_INSTALL: true
- name: 📥 Install deps
run: npm ci

- name: 🏗 Build
run: npm run build
run: npm run build --if-present

- name: 🚨 Format
run: npm run format
Expand All @@ -64,9 +44,8 @@ jobs:
with:
semantic_version: 18
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/changelog
@semantic-release/git
branches: |
[
'main',
Expand All @@ -75,6 +54,7 @@ jobs:
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down