Skip to content

Commit 026f576

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

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

.github/workflows/release-prod.yml

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

RELEASE.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
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+
2. Select the 'Run Workflow' dropdown on the right hand side of the page
15+
3. 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+
4. Select 'Run Workflow'
19+
5. Allow the workflow to run. Upon completion, the output of the 'publish-npm' action will report the published version string.
20+
21+
Following a successful run of the workflow, the package can be installed from the npm registry like any other package.
22+
323
## Development Releases
424

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

0 commit comments

Comments
 (0)