mirror of
https://github.com/certd/certd.git
synced 2026-04-20 09:50:50 +08:00
65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
name: publish-atomgit
|
|
on:
|
|
push:
|
|
branches: ['v2-dev']
|
|
paths:
|
|
- "trigger/publish.trigger"
|
|
workflow_run:
|
|
workflows: [ "build-image-for-release" ]
|
|
types:
|
|
- completed
|
|
workflow_dispatch: # 添加手动触发
|
|
# schedule:
|
|
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
|
# - cron: '17 19 * * *'
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
publish-atomgit:
|
|
runs-on: ubuntu-latest
|
|
if: |
|
|
github.event_name == 'workflow_dispatch' ||
|
|
(github.event.workflow_run.conclusion == 'success')
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
ref: 'v2-dev'
|
|
|
|
- name: get_certd_version
|
|
id: get_certd_version
|
|
uses: actions/github-script@v6
|
|
with:
|
|
result-encoding: string
|
|
script: |
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const pnpmWorkspace = "./pnpm-workspace.yaml";
|
|
fs.unlinkSync(pnpmWorkspace)
|
|
const jsonFilePath = "./packages/ui/certd-server/package.json";
|
|
const jsonContent = fs.readFileSync(jsonFilePath, 'utf-8');
|
|
const pkg = JSON.parse(jsonContent)
|
|
console.log("certd_version:",pkg.version);
|
|
return pkg.version
|
|
- run: |
|
|
npm install -g pnpm
|
|
pnpm install
|
|
npm run build
|
|
working-directory: ./packages/ui/certd-client
|
|
|
|
- name: publish_to_atomgit
|
|
id: publish_to_atomgit
|
|
run: |
|
|
rootDir=$(pwd)
|
|
rm -rf ./packages/ui/certd-client/dist/**/*.gz
|
|
cd ./packages/ui/certd-client/dist && zip -r ../ui.zip .
|
|
cd $rootDir
|
|
export ATOMGIT_TOKEN=${{ secrets.ATOMGIT_TOKEN }}
|
|
pnpm install
|
|
npm run publish_to_atomgit
|
|
working-directory: ./
|
|
|