|
71 | 71 | token: ${{ secrets.NPM_TOKEN }} |
72 | 72 | tag: ${{ env.GITHUB_REF_SLUG }} |
73 | 73 |
|
| 74 | + approve-release: |
| 75 | + if: github.ref == 'refs/heads/main' |
| 76 | + needs: npm-publish-contacts-snapshot |
| 77 | + runs-on: ubuntu-latest |
| 78 | + environment: release-approval |
| 79 | + steps: |
| 80 | + - name: Approve release |
| 81 | + run: |
| 82 | + echo "Release approved, proceeding with npm publish and production |
| 83 | + deployment" |
| 84 | + |
| 85 | + npm-release-contacts: |
| 86 | + if: github.ref == 'refs/heads/main' |
| 87 | + needs: [ build, npm-publish-contacts-snapshot, approve-release ] |
| 88 | + runs-on: ubuntu-latest |
| 89 | + outputs: |
| 90 | + releaseVersion: ${{ steps.release.outputs.version }} |
| 91 | + steps: |
| 92 | + - uses: actions/download-artifact@v4 |
| 93 | + with: |
| 94 | + name: contacts-dist |
| 95 | + - name: Prepare release version |
| 96 | + run: sed -i 's/-next\.0//' package.json |
| 97 | + - uses: actions/setup-node@v3 |
| 98 | + with: |
| 99 | + node-version: lts/* |
| 100 | + - uses: JS-DevTools/npm-publish@v4 |
| 101 | + id: release |
| 102 | + name: Release @pod-os/elements |
| 103 | + with: |
| 104 | + access: public |
| 105 | + token: ${{ secrets.NPM_TOKEN }} |
| 106 | + tag: latest |
| 107 | + |
| 108 | + bump-snapshot-versions: |
| 109 | + if: github.ref == 'refs/heads/main' |
| 110 | + needs: [ npm-release-contacts ] |
| 111 | + runs-on: ubuntu-latest |
| 112 | + permissions: |
| 113 | + contents: write |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@v3 |
| 116 | + with: |
| 117 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 118 | + - name: Configure git |
| 119 | + run: | |
| 120 | + git config user.name "github-actions[bot]" |
| 121 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 122 | + - name: Bump contacts to next development version |
| 123 | + id: bump-contacts |
| 124 | + uses: ./.github/actions/bump-version |
| 125 | + with: |
| 126 | + release-version: ${{ needs.npm-release-core.outputs.releaseVersion }} |
| 127 | + working-directory: ./contacts |
| 128 | + - name: Update package-lock.json |
| 129 | + run: npm install --package-lock-only |
| 130 | + - name: Commit and push version bumps |
| 131 | + run: | |
| 132 | + git add contacts/package.json package-lock.json |
| 133 | + git commit -m "chore(contacts): bump to next development versions [skip ci]" |
| 134 | + git push |
| 135 | +
|
74 | 136 | deploy-pod-os-contacts-app: |
75 | 137 | needs: build |
76 | 138 | if: github.ref == 'refs/heads/main' |
|
0 commit comments