-
Notifications
You must be signed in to change notification settings - Fork 12
97 lines (84 loc) · 2.87 KB
/
release-prod.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: 'Production Release (TEST)'
on:
# TODO(NOW): remove this
push:
branches:
- 'rw/prod-release-flow'
workflow_dispatch:
inputs:
version:
required: true
type: choice
description: Which version should be published?
# TODO(NOW): Remove
default: prepatch
options:
- prerelease
- prepatch
- preminor
- premajor
- patch
- minor
- major
jobs:
build_stencil_store:
name: Build
uses: ./.github/workflows/build.yml
release_store_stencil:
name: Publish Dev Build
runs-on: ubuntu-latest
needs: [ build_stencil_store ]
permissions:
contents: write
id-token: write
steps:
# Log the input from GitHub Actions for easy traceability
- name: Log GitHub Input
run: |
echo "Version: ${{ inputs.version }}"
shell: bash
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get Core Dependencies
uses: ./.github/workflows/actions/get-core-dependencies
# - name: Build
# uses: ./.github/workflows/build.yml
- name: Download Build Archive
uses: ./.github/workflows/actions/download-archive
with:
name: stencil-store
path: .
filename: stencil-store-build.zip
- name: Bump the Version
# TODO(NOW): Fix
run: npm version prepatch --no-git-tag
- name: Log Generated Changes
run: git --no-pager diff
shell: bash
# Commit changes resulting from bumping the version
# Note: The commit message is the result of performing the following actions:
# 1. Searching `package.json` for the string "version"
# 2. Assuming the first entry returned corresponds to this project's the version string
# 3. Stripping out all double quotes and commas from the version itself ($2 in awk corresponds to only the version here)
# 4. Printing the version string, prepended with a 'v' for 'version'
- name: Commit Release Preparations
run: |
git config user.name "Stencil Release Bot (on behalf of ${{ github.actor }})"
git config user.email "stencil-release-bot@ionic.io"
git add .
git commit -m "$(cat package.json | grep version | head -n 1 | awk '{ gsub(/"|,/, "", $2); print "v"$2}')"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: Push Branch to GitHub
run: |
git push origin
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Build Artifacts
uses: ./.github/workflows/actions/upload-archive
with:
# TODO(NOW): I just renamed this
name: stencil-store-for-publish
output: stencil-store-build-for-publish.zip
paths: ./dist/