-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
270 additions
and
0 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,28 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
versioning-strategy: increase | ||
directory: "/" | ||
target-branch: "develop" | ||
schedule: | ||
interval: daily | ||
time: "19:00" | ||
groups: | ||
storybook: | ||
patterns: | ||
- "@storybook/*" | ||
- storybook | ||
- "@chromatic-com/storybook" | ||
- "@whitespace/storybook-addon-html" | ||
- "chromatic" | ||
eslint: | ||
patterns: | ||
- "eslint*" | ||
- "@stylistic/eslint-plugin-js" | ||
- "esbuild-plugin-eslint" | ||
esbuild: | ||
patterns: | ||
- "esbuild*" | ||
open-pull-requests-limit: 10 | ||
reviewers: | ||
- qld-gov-au/qld-online-dev-team |
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,32 @@ | ||
# .github/release.yml | ||
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes | ||
# https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels | ||
|
||
changelog: | ||
categories: | ||
- title: Breaking Changes 🛠 | ||
labels: | ||
- Semver-Major | ||
- breaking-change | ||
|
||
- title: 🏕 Features | ||
labels: | ||
- '*' | ||
exclude: | ||
labels: | ||
- dependencies | ||
- bug | ||
- Semver-Major | ||
- breaking-change | ||
authors: | ||
- dependabot[bot] | ||
|
||
- title: 🐛 Bug Fixes | ||
labels: | ||
- bug | ||
|
||
- title: 👒 Dependencies | ||
labels: | ||
- dependencies | ||
authors: | ||
- dependabot[bot] |
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,76 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Build and Test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
concurrency: | ||
group: compile-${{ github.workflow }}-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [ '20' ] | ||
name: Lint, Test, Build and Deploy on Node ${{ matrix.node }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | ||
name: List the state of node modules | ||
continue-on-error: true | ||
run: npm list | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install #run on lint step (Which is cached) | ||
run: | # Install packages | ||
npm install --prefer-offline --no-audit --ignore-scripts | ||
#env: | ||
# NODE_AUTH_TOKEN: ${{ secrets.NEXUSREADONLY2NPMTOKEN }} | ||
|
||
# `npm rebuild` will run all those post-install scripts for us. | ||
- name: rebuild and prepare | ||
run: npm rebuild && npm run prepare --if-present | ||
|
||
- name: Lint | ||
run: | | ||
npm run lint | ||
- name: Test | ||
run: | | ||
npm run test | ||
- name: Build 🔧 | ||
run: | # build the files | ||
npm run build | ||
- uses: actions/upload-artifact@v4.3.1 | ||
with: | ||
name: Package | ||
path: ./dist |
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,23 @@ | ||
name: Publish Github Release Notes | ||
|
||
on: | ||
push: | ||
tags: | ||
- v*.*.* | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: write | ||
pages: write | ||
actions: read | ||
id-token: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Release | ||
run: gh release create "${GITHUB_REF#refs/tags/}" --generate-notes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
## See https://github.com/marella/material-symbols/blob/main/.github/workflows/update.yml where inspiration for this script came from | ||
name: Version Increment | ||
|
||
on: | ||
#schedule: | ||
# - cron: '23 1 * * MON' # Runs at 01:23 UTC on Monday | ||
workflow_dispatch: | ||
inputs: | ||
force: | ||
description: Force Update | ||
default: '0' | ||
dry: | ||
description: Dry Run | ||
default: '1' | ||
bump: | ||
type: choice | ||
description: Bump Version | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
env: | ||
HAVE_GIT_DEPLOY_KEY: ${{ secrets.DEPLOY_KEY != '' }} | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
ssh-key: ${{ secrets.DEPLOY_KEY }} | ||
|
||
- uses: git-actions/set-user@v1 | ||
|
||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | ||
name: List the state of node modules | ||
continue-on-error: true | ||
run: npm list | ||
|
||
|
||
- uses: actions/setup-node@v4 #setup registry to github package repo | ||
with: | ||
node-version: 20 | ||
|
||
- name: npm ci (don't run prepare) | ||
run: npm ci --ignore-scripts | ||
|
||
- name: Update & Push git tags | ||
if: ${{ env.HAVE_GIT_DEPLOY_KEY == 'true' }} | ||
run: | | ||
force="${{ github.event.inputs.force }}" | ||
dry="${{ github.event.inputs.dry }}" | ||
bump="${{ github.event.inputs.bump }}" | ||
if [ "$bump" = "" ]; then | ||
bump="patch" | ||
fi | ||
# Fetch the latest tags | ||
git fetch --tags | ||
# Get the latest tag | ||
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
# Get the current commit hash | ||
CURRENT_COMMIT=$(git rev-parse HEAD) | ||
# Check if there are changes between the latest tag and the current commit | ||
if git diff --quiet $LATEST_TAG $CURRENT_COMMIT; then | ||
if [ "$force" != "1" ]; then | ||
echo "No changes detected between the latest tag ($LATEST_TAG) and the current commit ($CURRENT_COMMIT)." >> $GITHUB_STEP_SUMMARY | ||
exit 0 | ||
else | ||
echo "Force flag set continuing: No changes detected between the latest tag ($LATEST_TAG) and the current commit ($CURRENT_COMMIT)." >> $GITHUB_STEP_SUMMARY | ||
fi | ||
else | ||
echo "Changes detected between the latest tag ($LATEST_TAG) and the current commit ($CURRENT_COMMIT)." >> $GITHUB_STEP_SUMMARY | ||
fi | ||
# Bump Version | ||
npm version "$bump" | ||
|
||
dry="${{ github.event.inputs.dry }}" | ||
# Push | ||
if [ "$dry" = "1" ]; then | ||
exit 0 | ||
fi | ||
git push --follow-tags | ||
|
||
- name: Git Commit - Is Skipped | ||
if: ${{ env.HAVE_GIT_DEPLOY_KEY != 'true' }} | ||
run: | | ||
echo "### Deployment config not configured" >> $GITHUB_STEP_SUMMARY | ||
echo "secrets.DEPLOY_KEY not existing, npm version can't be pushed" >> $GITHUB_STEP_SUMMARY | ||
echo "If this is a fork, please setup your own personal service account to publish to your own repo" >> $GITHUB_STEP_SUMMARY | ||
echo "## We recommend using a service account with the least permissions necessary." >> $GITHUB_STEP_SUMMARY | ||
echo "[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)" >> $GITHUB_STEP_SUMMARY |