-
Notifications
You must be signed in to change notification settings - Fork 12
52 lines (44 loc) · 1.61 KB
/
release-dev.yml
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
43
44
45
46
47
48
49
50
51
52
name: 'Dev Release'
on:
workflow_dispatch:
# Make this a reusable workflow, no value needed
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
jobs:
build_stencil_store:
name: Build
uses: ./.github/workflows/build.yml
get_dev_version:
name: Get Dev Build Version
runs-on: ubuntu-latest
outputs:
dev-version: ${{ steps.generate-dev-version.outputs.DEV_VERSION }}
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Generate Dev Version
id: generate-dev-version
run: |
PKG_JSON_VERSION=$(cat package.json | jq -r '.version')
GIT_HASH=$(git rev-parse --short HEAD)
# A unique string to publish Stencil Store under
# e.g. "2.1.0-dev.1677185104.7c87e34"
DEV_VERSION=$PKG_JSON_VERSION-dev.$(date +"%s").$GIT_HASH
echo "Using version $DEV_VERSION"
# store a key/value pair in GITHUB_OUTPUT
# e.g. "DEV_VERSION=2.1.0-dev.1677185104.7c87e34"
echo "DEV_VERSION=$DEV_VERSION" >> $GITHUB_OUTPUT
shell: bash
release_store_stencil:
name: Publish Dev Build
needs: [build_stencil_store, get_dev_version]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: ./.github/workflows/actions/publish-npm
with:
tag: dev
version: ${{ needs.get_dev_version.outputs.dev-version }}
token: ${{ secrets.NPM_TOKEN }}