Skip to content

Commit

Permalink
Merge pull request #12 from agiletech-web-dev/release
Browse files Browse the repository at this point in the history
  • Loading branch information
hunghg255 authored Jul 18, 2024
2 parents af21ad6 + f5ed01f commit 9ccad98
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 91 deletions.
33 changes: 0 additions & 33 deletions .github/cache/action.yml

This file was deleted.

73 changes: 66 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,78 @@
name: CI

on: [pull_request]
on:
push:
branches:
- main

pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install
run: pnpm install

- name: Lint
run: pnpm lint

typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install
run: pnpm install

- name: Build
run: pnpm build

- name: Typecheck
run: pnpm typecheck

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install
run: pnpm install

- name: Setup Continuous integration
uses: ./.github/cache
- name: Build
run: pnpm build

- run: pnpm run lint && pnpm run build
- name: Test
run: pnpm test
48 changes: 15 additions & 33 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,30 @@ env:

on:
push:
branches:
- release
branches: [main]

workflow_dispatch:

# This is what will cancel the workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Deploy-Deployment:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Continuous integration
uses: ./.github/cache
- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install
run: pnpm install

- name: Install Vercel CLI
run: pnpm install --global vercel@latest
Expand All @@ -32,28 +39,3 @@ jobs:
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

# - name: Notify Discord
# if: failure()
# uses: hunghg255/action-notifications@master
# with:
# discord_webhook: ${{ secrets.CI_CD_DISCORD_URL }}
# title: "Deploy dev failed"
# qrcode: https://dev-web.degenpark.io
# description: "Test here: https://dev-web.degenpark.io"

# notifification:
# needs: Deploy-Production
# runs-on: ubuntu-latest
# permissions:
# packages: write
# contents: read

# steps:
# - uses: hunghg255/action-notifications@master
# if: always()
# with:
# discord_webhook: ${{ secrets.CI_CD_DISCORD_URL }}
# title: "Deploy dev successfully"
# qrcode: https://dev-web.degenpark.io
# description: "Test here: https://dev-web.degenpark.io"
29 changes: 21 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,31 @@ concurrency:

jobs:
release:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Continuous integration
uses: ./.github/cache
- name: Install pnpm
uses: pnpm/action-setup@v4

- run: pnpm run publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/

- name: Install
run: pnpm install

- run: pnpm dlx changeloggithub@latest
- run: npx changeloggithub@latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- run: pnpm run publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@shikijs/transformers": "^1.10.3",
"js-utils-es": "^1.0.7",
"js-utils-es": "workspace:*",
"prettier": "^3.3.2",
"shiki": "^1.10.3"
},
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,13 @@
"format": "prettier --write .",
"prepare": "git-scm-hooks",
"prepublishOnly": "npm run build",
"release": "bumpp --commit --push --tag && npm publish",
"release": "bumpp --commit --push --tag",
"docs:dev": "pnpm run -C ./docs dev",
"docs:preview": "pnpm run -C ./docs preview",
"docs:build": "pnpm run -C ./docs build",
"verify-commit": "verify-commit-msg",
"gen-changelog": "esno ./scripts/genFuncUtils.ts && esno ./scripts/changelog.ts"
"gen-changelog": "esno ./scripts/genFuncUtils.ts && esno ./scripts/changelog.ts",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@antfu/eslint-config": "^2.22.0",
Expand Down
9 changes: 2 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9ccad98

Please sign in to comment.