Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(repo): stub automated production releases #472

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: 'Production Release (TEST)'

on:
workflow_dispatch:
inputs:
version:
required: true
type: choice
description: Which version should be published?
options:
- prerelease
- prepatch
- preminor
- premajor
- patch
- minor
- major

jobs:
build_stencil_store:
name: Build
uses: ./.github/workflows/build.yml

release_store_stencil:
name: Publish Prod 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: Download Build Archive
uses: ./.github/workflows/actions/download-archive
with:
name: stencil-store
path: .
filename: stencil-store-build.zip

- name: Bump the Version
run: npm version ${{ inputs.version }} --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:
name: stencil-store-for-publish
output: stencil-store-build-for-publish.zip
paths: ./dist/
26 changes: 26 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Releasing Stencil Store

## Production Releases

Production Releases (or "Prod Releases", "Prod Builds") are installable instances of Stencil Store that are:
- Published to the npm registry for distribution within and outside the Stencil team
- Meant for general consumption by users

### How to Publish

Only members of the Stencil team may create prod builds of Stencil Store.
To publish the package:
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.
1. Select the 'Run Workflow' dropdown on the right hand side of the page
1. The dropdown will ask you for a version type to publish.
Stencil Store follows semantic versioning.
Review the changes on `main` and select the most appropriate release type.
1. Select 'Run Workflow'
1. Allow the workflow to run. Upon completion, the output of the 'publish-npm' action will report the published version string.
1. Navigate to the project's [Releases Page](https://github.com/ionic-team/stencil-store/releases)
1. Select 'Draft a new release'
1. Select the tag of the version you just created in the 'Choose a tag' dropdown
1. Click "Generate release notes"
1. Ensure this is the latest release
1. Hit 'Publish release'

Following a successful run of the workflow, the package can be installed from the npm registry like any other package.

## Development Releases

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