Skip to content

Commit

Permalink
ci(github-actions): 修改为提前获得新版本号
Browse files Browse the repository at this point in the history
  • Loading branch information
Aysnine committed Apr 29, 2020
1 parent d041845 commit 784847f
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
check:
name: Code quality check
runs-on: ubuntu-latest
outputs:
semantic: ${{ toJSON(steps.semantic.outputs) }} # ! MUST BE STRING
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand All @@ -24,6 +26,18 @@ jobs:
# echo "IS_TEST=true" >> .env.local
# yarn test:unit

- name: Semantic Release with dryRun
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
dry_run: true
extra_plugins: |
@semantic-release/changelog@3.0.6
@semantic-release/git@7.0.18
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

build:
needs: check
name: Build
Expand All @@ -33,11 +47,19 @@ jobs:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2

- uses: actions/setup-node@v1
with:
node-version: '12.x'
- uses: bahmutov/npm-install@v1

- name: Tricky version
if: fromJSON(needs.check.outputs.semantic).new_release_published == 'true'
run: |
npx npe version ${{ fromJSON(needs.check.outputs.semantic).new_release_version }}
- name: Build
run: yarn build -p never

Expand Down Expand Up @@ -66,10 +88,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
# - uses: bahmutov/npm-install@v1

- name: Download artifact
uses: actions/download-artifact@v1
Expand Down

0 comments on commit 784847f

Please sign in to comment.