-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (40 loc) · 1.61 KB
/
prerelease.yml
File metadata and controls
42 lines (40 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
on:
pull_request:
branches:
- master
name: prerelease
jobs:
prerelease:
runs-on: ubuntu-latest
environment: ci
env:
CODEARTIFACT_REGISTRY_SERVER: ${{ vars.CODEARTIFACT_REGISTRY_SERVER }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version-file: '.tool-versions'
- uses: ./.github/actions/prep-secure-registries
with:
aws-access-key-id: ${{ secrets.SHARED_CODEARTIFACT_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SHARED_CODEARTIFACT_AWS_SECRET_KEY }}
- run: yarn install --immutable
- run: yarn dist
- run: npm version prerelease --preid=$GITHUB_HEAD_REF-`git rev-parse --short HEAD` --git-tag-version=false --commit-hooks=false
- run: |
npm config set registry https://npm.pkg.github.com
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}
npm publish --tag $GITHUB_HEAD_REF
- name: Extract NPM package name
run: echo "::set-output name=npm-name::`node -p -e "require('./package.json').name"`"
id: npm-name
- name: Extract npm package version
run: echo "::set-output name=npm-version::`node -p -e "require('./package.json').version"`"
id: npm-version
- name: Comment PR
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
message: |
Released prerelease version `${{ steps.npm-version.outputs.npm-version }}`.
You may now run `npm install ${{ steps.npm-name.outputs.npm-name }}@${{ github.head_ref }}`