|
5 | 5 | - main
|
6 | 6 | workflow_dispatch: {}
|
7 | 7 | jobs:
|
8 |
| - build: |
| 8 | + publish: |
| 9 | + # if: github.event.pull_request.merged == true |
9 | 10 | runs-on: ubuntu-latest
|
| 11 | + |
10 | 12 | steps:
|
11 |
| - - uses: actions/checkout@v2 |
12 |
| - - name: Install packages |
13 |
| - run: | |
14 |
| - export NODE_ENV=dev |
15 |
| - npm ci |
16 |
| - npm run lerna-ci |
17 |
| - - name: Run lint |
18 |
| - run: npm run lerna-lint |
19 |
| - - name: Run tests |
20 |
| - run: npm run lerna-test |
21 |
| - release_github: |
22 |
| - name: Publish to GitHub Releases |
23 |
| - needs: release |
24 |
| - runs-on: ubuntu-latest |
25 |
| - permissions: |
26 |
| - contents: write |
27 |
| - if: needs.release.outputs.latest_commit == github.sha |
28 |
| - steps: |
29 |
| - - name: Download build artifacts |
30 |
| - uses: actions/download-artifact@v2 |
31 |
| - with: |
32 |
| - name: dist |
33 |
| - path: dist |
34 |
| - - name: Release |
35 |
| - run: errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R |
36 |
| - $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) |
37 |
| - --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode |
38 |
| - -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then |
39 |
| - cat $errout; exit $exitcode; fi |
40 |
| - env: |
41 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
42 |
| - GITHUB_REPOSITORY: ${{ github.repository }} |
43 |
| - GITHUB_REF: ${{ github.ref }} |
| 13 | + - name: "Checkout" |
| 14 | + uses: actions/checkout@v2 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + |
| 18 | + - name: "Use NodeJS 14" |
| 19 | + uses: actions/setup-node@v2 |
| 20 | + with: |
| 21 | + node-version: '14' |
| 22 | + |
| 23 | + - name: Install packages |
| 24 | + run: | |
| 25 | + npm ci |
| 26 | + npm run lerna-ci |
| 27 | +
|
| 28 | + # - name: "Setup npm" |
| 29 | + # run: | |
| 30 | + # npm set @xcanchal:registry=https://npm.pkg.github.com/xcanchal |
| 31 | + # npm set "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" |
| 32 | + |
| 33 | + - name: "Version and publish" |
| 34 | + env: |
| 35 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + run: | |
| 37 | + git config user.name "${{ github.actor }}" |
| 38 | + git config user.email "${{ github.actor}}@users.noreply.github.com" |
| 39 | +
|
| 40 | + if [ ${{ github.base_ref }} = main ]; then |
| 41 | + npx lerna version --conventional-commits --create-release github --yes |
| 42 | + else |
| 43 | + npx lerna version --conventional-commits --conventional-prerelease --preid beta --create-release github --yes |
| 44 | + fi |
| 45 | +
|
| 46 | + # npx lerna publish from-git --yes |
| 47 | +
|
44 | 48 | slack:
|
45 | 49 | name: Publish to slack channel
|
46 | 50 | needs:
|
47 |
| - - release_npm |
48 |
| - - release_pypi |
| 51 | + - publish |
49 | 52 | runs-on: ubuntu-latest
|
50 | 53 | steps:
|
51 | 54 | - name: publish latest release
|
|
0 commit comments