Skip to content

Commit e296490

Browse files
authored
Add release workflow (#88)
Signed-off-by: Todd Baert <[email protected]>
1 parent 6d4ad39 commit e296490

File tree

4 files changed

+69
-4
lines changed

4 files changed

+69
-4
lines changed

.github/workflows/publish-dev.yaml renamed to .github/workflows/experimental-release.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Publishes a pre-release, incrementing the final integer (ie: 0.0.1-alpha.1 => 0.0.1-alpha.2), if any ts files or the package.json have changed. Pushes package.json changes back to main.
22

3-
name: publish-dev
3+
name: experimental-release
44

55
on:
66
push:
@@ -13,7 +13,7 @@ on:
1313
- '.github/workflows/**'
1414

1515
jobs:
16-
publish-dev:
16+
experimental-release:
1717
# if the last author is CI, we don't need to publish again.
1818
if: ${{ github.event.head_commit.author.email != '[email protected]' }}
1919
runs-on: ubuntu-latest
@@ -32,6 +32,7 @@ jobs:
3232
- name: Build
3333
run: npm run build
3434

35+
# this is for test coverage
3536
- name: Test
3637
run: npm run test
3738

@@ -44,7 +45,7 @@ jobs:
4445
git config --global user.email '[email protected]'
4546
4647
- name: Version
47-
run: npm version prerelease
48+
run: npm version prerelease --preid experimental
4849

4950
- name: Publish
5051
run: npm publish --access public

.github/workflows/lint-pr.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Lint PR'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v4
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr-checks.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: pr-checks
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
69
branches:
710
- main
811

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
3+
on:
4+
push:
5+
# run only against tags prefixed with v
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
token: ${{ secrets.GIT_PUSH }} # use a custom PAT of a user with allows branch-protection bypass
17+
- uses: actions/setup-node@v3
18+
with:
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: Fetch all tags
22+
run: git fetch --force --tags
23+
24+
- name: Install
25+
run: npm ci
26+
27+
- name: Build
28+
run: npm run build
29+
30+
- name: Configure git
31+
run: |
32+
git config --global user.name 'openfeature-ci'
33+
git config --global user.email '[email protected]'
34+
35+
- name: Version
36+
run: npm version ${{ env.GITHUB_REF_NAME }}
37+
38+
- name: Publish
39+
run: npm publish --access public
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
43+
- name: Push Version Update
44+
run: git push

0 commit comments

Comments
 (0)