@unite-us/app-create-referral 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: 'Bump NPM version'
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches:
|
|
5
|
+
- '*'
|
|
6
|
+
jobs:
|
|
7
|
+
build-and-publish:
|
|
8
|
+
name: Publish alpha version
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
env:
|
|
11
|
+
# See https://github.community/t/package-not-found-in-the-github-registry/16251
|
|
12
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout code
|
|
15
|
+
uses: actions/checkout@v2
|
|
16
|
+
|
|
17
|
+
- name: Cache node modules
|
|
18
|
+
uses: actions/cache@v2
|
|
19
|
+
env:
|
|
20
|
+
cache-name: cache-node-modules
|
|
21
|
+
with:
|
|
22
|
+
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
23
|
+
path: ~/.npm
|
|
24
|
+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package-lock.json') }}
|
|
25
|
+
restore-keys: |
|
|
26
|
+
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
27
|
+
${{ runner.os }}-build-
|
|
28
|
+
${{ runner.os }}-
|
|
29
|
+
|
|
30
|
+
- name: Add .npmrc
|
|
31
|
+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies (Using NPM_TOKEN)
|
|
34
|
+
run: npm install
|
|
35
|
+
|
|
36
|
+
- name: build
|
|
37
|
+
run: npm run build:dist
|
|
38
|
+
|
|
39
|
+
- name: Create Alpha Version
|
|
40
|
+
id: publish_version
|
|
41
|
+
run: |
|
|
42
|
+
BRANCH_NAME=$(echo "${{ github.head_ref }}" | sed 's/[^[:alnum:]]/-/g' | tr -s '-')
|
|
43
|
+
COMMIT_HASH=$(git rev-parse --short HEAD)
|
|
44
|
+
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
45
|
+
CURRENT_VERSION=$(npm view "$PACKAGE_NAME" version)
|
|
46
|
+
|
|
47
|
+
# Set alpha version and publish
|
|
48
|
+
ALPHA_VERSION="${CURRENT_VERSION}-${BRANCH_NAME}-${COMMIT_HASH}"
|
|
49
|
+
|
|
50
|
+
npm version "$ALPHA_VERSION" --no-git-tag-version
|
|
51
|
+
npm publish --tag alpha
|
|
52
|
+
echo "published_version=$ALPHA_VERSION" >> $GITHUB_OUTPUT
|
|
53
|
+
|
|
54
|
+
- name: Post comment
|
|
55
|
+
if: success()
|
|
56
|
+
uses: peter-evans/create-or-update-comment@v3
|
|
57
|
+
with:
|
|
58
|
+
token: ${{ secrets.NPM_BUMP }}
|
|
59
|
+
issue-number: ${{ github.event.pull_request.number }}
|
|
60
|
+
body: |
|
|
61
|
+
:package: Alpha version published: `${{ steps.publish_version.outputs.published_version }}`
|