|
7 | 7 | - main |
8 | 8 | workflow_dispatch: {} |
9 | 9 | jobs: |
10 | | - build: |
| 10 | + release: |
11 | 11 | runs-on: ubuntu-latest |
12 | 12 | env: |
13 | 13 | CI: "true" |
| 14 | + RELEASE: "true" |
14 | 15 | steps: |
15 | 16 | - name: Checkout |
16 | 17 | uses: actions/checkout@v2 |
17 | 18 | with: |
18 | 19 | fetch-depth: 0 |
19 | 20 | - name: Install dependencies |
20 | 21 | run: yarn install --check-files --frozen-lockfile |
21 | | - - name: Synthesize project files |
22 | | - run: npx projen |
23 | 22 | - name: Anti-tamper check |
24 | | - run: git diff --exit-code |
| 23 | + run: git diff --ignore-space-at-eol --exit-code |
25 | 24 | - name: Set git identity |
26 | 25 | run: |- |
27 | | - git config user.name "Auto-bump" |
| 26 | + git config user.name "Automation" |
28 | 27 | git config user.email "[email protected]" |
29 | 28 | - name: Bump to next version |
30 | 29 | run: npx projen bump |
31 | 30 | - name: Build |
32 | 31 | run: npx projen build |
33 | | - - name: Upload coverage to Codecov |
34 | | - uses: codecov/codecov-action@v1 |
35 | | - with: |
36 | | - directory: coverage |
37 | | - - name: Anti-tamper check |
38 | | - run: git diff --exit-code |
39 | | - - name: Push commits |
40 | | - run: git push origin HEAD:${{ github.ref }} |
41 | | - - name: Push tags |
42 | | - run: git push --follow-tags origin ${{ github.ref }} |
| 32 | + - name: Check for new commits |
| 33 | + id: git_remote |
| 34 | + run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{ |
| 35 | + github.ref }} | cut -f1)" |
| 36 | + - name: Create release |
| 37 | + if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} |
| 38 | + run: gh release create v$(node -p "require('./package.json').version") -F |
| 39 | + .changelog.tmp.md -t v$(node -p "require('./package.json').version") |
| 40 | + env: |
| 41 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 42 | + - name: Unbump |
| 43 | + run: npx projen unbump |
43 | 44 | - name: Upload artifact |
| 45 | + if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} |
44 | 46 | |
45 | 47 | with: |
46 | 48 | name: dist |
47 | 49 | path: dist |
| 50 | + - name: Anti-tamper check |
| 51 | + run: git diff --ignore-space-at-eol --exit-code |
48 | 52 | release_npm: |
49 | 53 | name: Release to NPM |
50 | | - needs: build |
| 54 | + needs: release |
51 | 55 | runs-on: ubuntu-latest |
52 | 56 | container: |
53 | 57 | image: jsii/superchain |
|
0 commit comments