feat: release-automation (#1095)

This commit is contained in:
jeremywu
2020-12-23 16:57:31 +08:00
committed by GitHub
parent c17332f3a9
commit 61f8317fa1
2 changed files with 15 additions and 7 deletions

View File

@@ -28,10 +28,10 @@ jobs:
registry-url: https://registry.npmjs.org/
- name: Get version
run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Bootstrap
run: yarn bootstrap
- name: build
run: yarn build
env:
TAG_VERSION: ${{env.TAG_VERSION}}
- name: Publish
run: sh ./scripts/publish.sh
env:
@@ -49,10 +49,10 @@ jobs:
registry-url: https://npm.pkg.github.com/
- name: Get version
run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Bootstrap
run: yarn bootstrap
- name: build
run: yarn build
env:
TAG_VERSION: ${{env.TAG_VERSION}}
- name: Publish
run: sh ./scripts/publish.sh
env:

View File

@@ -1,6 +1,14 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs')
const path = require('path')
const { version } = require('../package.json')
fs.writeFileSync(path.resolve(__dirname, '../packages/element-plus/version.ts'), `export const version = '${version}'
`)
const tagVer = process.env.TAG_VERSION
if (tagVer) {
version = tagVer.startsWith('v') ? tagVer.slice(1) : tagVer
} else {
version = require('../package.json').version
}
fs.writeFileSync(
path.resolve(__dirname, '../packages/element-plus/version.ts'),
`export const version = '${version}'
`,
)