-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add updated release process for ITS (#286)
Co-authored-by: Milap Sheth <milap@interoplabs.io>
- Loading branch information
1 parent
c58ed5e
commit 0949437
Showing
19 changed files
with
1,534 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Install node.js dependencues | ||
description: 'Setup node.js and install dependencies' | ||
|
||
inputs: | ||
node-version: | ||
description: 'The version of node.js CLI to install' | ||
required: true | ||
default: '18' | ||
|
||
runs: | ||
using: 'composite' | ||
|
||
steps: | ||
- name: Setup Node | ||
# TODO: consider while migrating the `setup-node` action later the usage of `blacksmith` actions | ||
uses: useblacksmith/setup-node@v5 | ||
with: | ||
node-version: '${{ inputs.node-version }}' | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: npm ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Setup tools | ||
description: 'Setup tools for repo workflows' | ||
|
||
inputs: | ||
install-nodejs: | ||
description: "Install nodejs and setup repo's npm package" | ||
required: false | ||
default: 'false' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
# This Action bundles other reusable actions in case needed. | ||
|
||
# Install Node.js and its dependencies | ||
- name: Setup node.js and install dependencies | ||
if: inputs.install-nodejs == 'true' | ||
uses: ./.github/actions/nodejs-ci | ||
with: | ||
node-version: '18' # Version is hardcoded across all other steps to ensure stability of the code, although the `package.json` has `>=18` engine version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# This workflow concerns the preparation of the `changeset` PR and keeping it updated by tracking the changes on `main` branch. | ||
name: Create Release PR | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
create-release-pr: | ||
name: Create Release PR | ||
runs-on: blacksmith-2vcpu-ubuntu-2204 | ||
steps: | ||
- name: Check if a branch is whitelisted and maintained | ||
id: branch-check | ||
run: | | ||
BRANCH_NAME="${GITHUB_REF#refs/heads/}" | ||
WHITELISTED_BRANCHES=("main" "releases/*") | ||
IS_WHITELISTED=false | ||
# Check the branch against the whitelist using wildcard matching | ||
for BRANCH in "${WHITELISTED_BRANCHES[@]}"; do | ||
if [[ "$BRANCH_NAME" == $BRANCH ]]; then | ||
IS_WHITELISTED=true; | ||
break; | ||
fi | ||
done | ||
if [ "$IS_WHITELISTED" == true ]; then | ||
echo "Branch is whitelisted: $BRANCH_NAME" | ||
else | ||
echo "Branch $BRANCH_NAME is not whitelisted." | ||
exit 1 | ||
fi | ||
echo "branch_name=${BRANCH_NAME}" >> "$GITHUB_OUTPUT" | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
ref: ${{ steps.branch-check.outputs.branch_name }} | ||
|
||
- name: Check for changeset files | ||
run: | | ||
if ! ls .changeset/*.md | grep -q '\.changeset\/[a-z-]\+\.md$'; then | ||
echo "No changeset files found. Exiting workflow." | ||
exit 1 | ||
fi | ||
echo "Changeset files found. Continuing with the workflow." | ||
- name: Setup tools | ||
uses: ./.github/actions/setup-tools | ||
with: | ||
install-nodejs: 'true' | ||
|
||
# Keep the version of the PRs up-to-date | ||
- name: Create Release Pull Request | ||
id: release-pr | ||
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7 | ||
with: | ||
# This branch context is ignored in this step: https://github.com/changesets/action/blob/50750fa876cc1e54c7cb972db5e2f7271fc53d99/src/run.ts#L328, therefore the usage of `branch` | ||
branch: ${{ steps.branch-check.outputs.branch_name }} | ||
title: 'chore(release): bump version and update changelog' | ||
commit: 'chore(release): bump version and update changelog' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This workflow publishes snapshot releases as an npm package. These releases aren't supposed to be reusable in `production` environments. | ||
# It's triggered manually in case a snapshot release would be needed for testing purposes. | ||
name: Release Snapshot | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
release-snapshot: | ||
name: Release Snapshot | ||
runs-on: blacksmith-2vcpu-ubuntu-2204 | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup tools | ||
uses: ./.github/actions/setup-tools | ||
with: | ||
install-nodejs: 'true' | ||
|
||
- name: Build and Publish a Snapshot to NPM | ||
run: | | ||
npm run release-snapshot | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
Oops, something went wrong.