Skip to content

Commit 9f75c0d

Browse files
committed
ci: release @pod-os/contacts via pipeline
1 parent 40ff2aa commit 9f75c0d

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed

.github/workflows/contacts-ci-cd.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,68 @@ jobs:
7171
token: ${{ secrets.NPM_TOKEN }}
7272
tag: ${{ env.GITHUB_REF_SLUG }}
7373

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+
74136
deploy-pod-os-contacts-app:
75137
needs: build
76138
if: github.ref == 'refs/heads/main'

contacts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pod-os/contacts",
3-
"version": "0.0.1",
3+
"version": "0.1.0-next.0",
44
"description": "PodOS contact manager",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.js",

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)