Skip to content

Commit 8fa3bf0

Browse files
committed
chore(repo): enable production releases
1 parent 66047e8 commit 8fa3bf0

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

.github/workflows/release-prod.yml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: 'Production Release (TEST)'
2+
3+
on:
4+
# TODO(NOW): remove this
5+
push:
6+
branches:
7+
- 'rw/prod-release-flow'
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
required: true
12+
type: choice
13+
description: Which version should be published?
14+
# TODO(NOW): Remove
15+
default: prepatch
16+
options:
17+
- prerelease
18+
- prepatch
19+
- preminor
20+
- premajor
21+
- patch
22+
- minor
23+
- major
24+
25+
jobs:
26+
build_stencil_store:
27+
name: Build
28+
uses: ./.github/workflows/build.yml
29+
30+
release_store_stencil:
31+
name: Publish Dev Build
32+
runs-on: ubuntu-latest
33+
needs: [ build_stencil_store ]
34+
permissions:
35+
contents: write
36+
id-token: write
37+
steps:
38+
# Log the input from GitHub Actions for easy traceability
39+
- name: Log GitHub Input
40+
run: |
41+
echo "Version: ${{ inputs.version }}"
42+
shell: bash
43+
44+
- name: Checkout Code
45+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
46+
47+
- name: Get Core Dependencies
48+
uses: ./.github/workflows/actions/get-core-dependencies
49+
50+
# - name: Build
51+
# uses: ./.github/workflows/build.yml
52+
53+
- name: Download Build Archive
54+
uses: ./.github/workflows/actions/download-archive
55+
with:
56+
name: stencil-store
57+
path: .
58+
filename: stencil-store-build.zip
59+
60+
- name: Bump the Version
61+
# TODO(NOW): Fix
62+
run: npm version prepatch --no-git-tag
63+
64+
- name: Log Generated Changes
65+
run: git --no-pager diff
66+
shell: bash
67+
68+
# Commit changes resulting from bumping the version
69+
# Note: The commit message is the result of performing the following actions:
70+
# 1. Searching `package.json` for the string "version"
71+
# 2. Assuming the first entry returned corresponds to this project's the version string
72+
# 3. Stripping out all double quotes and commas from the version itself ($2 in awk corresponds to only the version here)
73+
# 4. Printing the version string, prepended with a 'v' for 'version'
74+
- name: Commit Release Preparations
75+
run: |
76+
git config user.name "Stencil Release Bot (on behalf of ${{ github.actor }})"
77+
git config user.email "stencil-release-bot@ionic.io"
78+
git add .
79+
git commit -m "$(cat package.json | grep version | head -n 1 | awk '{ gsub(/"|,/, "", $2); print "v"$2}')"
80+
env:
81+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
shell: bash
83+
84+
85+
- name: Push Branch to GitHub
86+
run: |
87+
git push origin
88+
env:
89+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
91+
- name: Upload Build Artifacts
92+
uses: ./.github/workflows/actions/upload-archive
93+
with:
94+
# TODO(NOW): I just renamed this
95+
name: stencil-store-for-publish
96+
output: stencil-store-build-for-publish.zip
97+
paths: ./dist/

RELEASE.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Releasing Stencil Store
22

3+
## Production Releases
4+
5+
Production Releases (or "Prod Releases", "Prod Builds") are installable instances of Stencil Store that are:
6+
- Published to the npm registry for distribution within and outside the Stencil team
7+
- Meant for general consumption by users
8+
9+
### How to Publish
10+
11+
Only members of the Stencil team may create prod builds of Stencil Store.
12+
To publish the package:
13+
1. Navigate to the [Stencil Store Prod Release GitHub Action](https://github.com/ionic-team/stencil-store/actions/workflows/release-prod.yml) in your browser.
14+
1. Select the 'Run Workflow' dropdown on the right hand side of the page
15+
1. The dropdown will ask you for a version type to publish.
16+
Stencil Store follows semantic versioning.
17+
Review the changes on `main` and select the most appropriate release type.
18+
1. Select 'Run Workflow'
19+
1. Allow the workflow to run. Upon completion, the output of the 'publish-npm' action will report the published version string.
20+
1. Navigate to the project's [Releases Page](https://github.com/ionic-team/stencil-store/releases)
21+
1. Select 'Draft a new release'
22+
1. Select the tag of the version you just created in the 'Choose a tag' dropdown
23+
1. Click "Generate release notes"
24+
1. Ensure this is the latest release
25+
1. Hit 'Publish release'
26+
27+
Following a successful run of the workflow, the package can be installed from the npm registry like any other package.
28+
329
## Development Releases
430

531
Development Releases (or "Dev Releases", "Dev Builds") are installable instances of Stencil Store that are:

0 commit comments

Comments
 (0)