Skip to content

Commit fc5695a

Browse files
committed
Merge branch 'obs-928-migrate-to-github-action-add-gh-prod' into 'main'
Github prod pipeline See merge request platformsh/observability/blackfire/blackfire.io!39578
2 parents f08a3db + 5900f02 commit fc5695a

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/workflows/release_prod.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: release prod
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
coding-style:
10+
name: Probe NodeJs - Code Style
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 3
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: latest
19+
20+
- run: |
21+
make eslint
22+
23+
unit-tests:
24+
name: Probe Node.js ${{ matrix.version }} - Unit tests
25+
runs-on: ubuntu-latest
26+
needs: coding-style
27+
timeout-minutes: 3
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
version:
32+
- 18
33+
- 20
34+
- 21
35+
- 22
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: ${{ matrix.version }}
42+
43+
- run: |
44+
make test
45+
46+
release:
47+
name: Probe NodeJs - Release
48+
runs-on: ubuntu-latest
49+
needs: unit-tests
50+
timeout-minutes: 3
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- uses: actions/setup-node@v4
55+
with:
56+
node-version: latest
57+
58+
- run: |
59+
./release.sh
60+
env:
61+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
TAG: ${{ github.ref_name }}

release.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
# get internal version
6+
VERSION=`node -p "require('./package.json').version"`
7+
8+
if [ "$TAG" != "v$VERSION" ]; then
9+
echo "ERROR: tag ${TAG} does not match package version ${VERSION}"
10+
exit 255
11+
fi
12+
13+
npm set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
14+
npm publish --access public

0 commit comments

Comments
 (0)