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

Feature/prerelease support #3

Merged
merged 93 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
47f8abf
Feat: added prerelease support to automatic versioning
Akalanka47000 May 6, 2023
8ea1a26
Merge pull request #39 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
fd0f745
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 6, 2023
9c9adff
Chore: cleaned commit prefix check
Akalanka47000 May 6, 2023
744b7ef
Merge pull request #40 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
8616b16
Patch: eslint config - increased chain depth
Akalanka47000 May 6, 2023
5cf6a29
Merge pull request #41 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
8726bfd
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 6, 2023
d301432
Chore: generalized version bump script
Akalanka47000 May 6, 2023
c2823b2
Chore: updated prerelease tag
Akalanka47000 May 6, 2023
ca75247
Chore: updated publish script to read tag from env
Akalanka47000 May 6, 2023
cb8a88c
Chore: refactored release logic to custom action
Akalanka47000 May 6, 2023
e80f9b4
Chore: added prerelease workflow
Akalanka47000 May 6, 2023
b842bbb
Chore: updated automatic versioning instructions
Akalanka47000 May 6, 2023
b5de992
Chore: fixed prerelease commit message
Akalanka47000 May 6, 2023
14c1c30
Chore: updated test workflow triggers
Akalanka47000 May 6, 2023
f37504c
Merge pull request #42 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
43c67bd
Chore: fixed update release info step
Akalanka47000 May 6, 2023
e9e9901
Chore: updated release script
Akalanka47000 May 6, 2023
44990b9
Feat: @sliit-foss/automatic-versioning -> added prerelease branch sup…
Akalanka47000 May 6, 2023
ca4818f
Feat: @sliit-foss/automatic-versioning -> added prerelease branch sup…
Akalanka47000 May 6, 2023
30187cc
Merge branch 'development' into feature/prerelease-support
Akalanka47000 May 6, 2023
67c882e
Merge pull request #43 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
cb915fd
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 6, 2023
4e69e40
Patch: added filter command to release
Akalanka47000 May 6, 2023
b44be81
Merge pull request #44 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
9f59863
Patch: added filter command to release
Akalanka47000 May 6, 2023
241d036
Merge remote-tracking branch 'upstream/development' into feature/prer…
Akalanka47000 May 6, 2023
55e5ba1
Merge remote-tracking branch 'upstream/development' into feature/prer…
Akalanka47000 May 6, 2023
18e40f7
Merge pull request #45 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
6862130
Merge remote-tracking branch 'upstream/development' into feature/prer…
Akalanka47000 May 6, 2023
9d40533
Merge remote-tracking branch 'upstream/development' into feature/prer…
Akalanka47000 May 6, 2023
e5e1ef0
Merge pull request #46 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
d8513c5
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 6, 2023
6ccd152
Feat: setup remote caching
Akalanka47000 May 6, 2023
f1ad041
Merge pull request #47 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
fba5d43
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 6, 2023
b948ac1
Feat: setup remote caching
Akalanka47000 May 6, 2023
6da1c9a
Merge pull request #48 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
4fdf4f4
Fix: removed console.log
Akalanka47000 May 6, 2023
069a84e
Merge pull request #49 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
427f974
Fix: commit message check
Akalanka47000 May 6, 2023
537385a
Merge pull request #50 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
9209ae5
Patch: removed debug logs
Akalanka47000 May 6, 2023
67c3a95
Merge remote-tracking branch 'upstream/development' into feature/prer…
Akalanka47000 May 6, 2023
6abd3a4
Merge pull request #51 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
363f346
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 6, 2023
f2e1689
Merge remote-tracking branch 'upstream/development' into feature/prer…
Akalanka47000 May 6, 2023
8640131
Merge branch 'feature/prerelease-support' of https://github.com/Akala…
Akalanka47000 May 6, 2023
ac66be8
Merge remote-tracking branch 'upstream/development' into feature/prer…
Akalanka47000 May 6, 2023
215891d
Patch: prerelease current version check
Akalanka47000 May 6, 2023
ec7bb28
Merge pull request #52 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
1ec14f1
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 6, 2023
358c94e
Chore: added release.txt file to divide caching process
Akalanka47000 May 6, 2023
f74ee4b
Merge pull request #53 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
f211db0
Merge pull request #54 from sliit-foss/development
Akalanka47000 May 6, 2023
6c845fa
Chore: replaced release.txt with cache-control.js file
Akalanka47000 May 6, 2023
7d90a19
Merge pull request #55 from sliit-foss/development
Akalanka47000 May 6, 2023
16fba38
Patch: minor cleanups
Akalanka47000 May 6, 2023
3abb9c9
Merge pull request #56 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 6, 2023
ab9fa83
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 6, 2023
c8a2766
Patch: added ignore prefix support to automatic versioning
Akalanka47000 May 7, 2023
db43881
Merge pull request #58 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 7, 2023
1149146
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 7, 2023
1a30f66
Merge pull request #57 from sliit-foss/development
Akalanka47000 May 7, 2023
2bb722d
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 7, 2023
1f1ae5a
Patch(automatic-versioning): commit scope recognition
Akalanka47000 May 7, 2023
236fdb6
Merge pull request #59 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 7, 2023
beea0b3
Chore: removed dependencies between base scripts
Akalanka47000 May 7, 2023
73c0d67
Merge pull request #60 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 7, 2023
7cc67a3
Merge remote-tracking branch 'upstream/development' into feature/prer…
Akalanka47000 May 7, 2023
d02eac2
Chore: updated turbo.json dependencies
Akalanka47000 May 7, 2023
61e8a96
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 7, 2023
1aefdd4
Merge remote-tracking branch 'upstream/development' into feature/prer…
Akalanka47000 May 7, 2023
0fa37fe
Merge pull request #61 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 7, 2023
d0ee301
Chore: updated release workflow
Akalanka47000 May 7, 2023
34048c3
Merge pull request #62 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 7, 2023
69249bc
Chore: updated version bump script
Akalanka47000 May 7, 2023
ce8745b
Merge pull request #63 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 7, 2023
1f19efa
Chore: updated release workflow
Akalanka47000 May 7, 2023
4215bc0
Merge pull request #64 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 7, 2023
4bed9ca
Chore: updated release workflow
Akalanka47000 May 7, 2023
db31448
Merge pull request #65 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 7, 2023
b5c31dd
Patch(automatic-versioning): commit scope recognition
Akalanka47000 May 7, 2023
8bc41c1
Merge pull request #66 from Akalanka47000/feature/prerelease-support
Akalanka47000 May 7, 2023
dce386f
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 7, 2023
6146a90
Patch(automatic-versioning): current version check
Akalanka47000 May 7, 2023
347a5f2
Merge branch 'development' of https://github.com/sliit-foss/npm-catal…
Akalanka47000 May 7, 2023
bcac83f
Patch(automatic-versioning): commit prefix evaluations
Akalanka47000 May 7, 2023
905b5be
Patch(automatic-versioning): allow same version err
Akalanka47000 May 7, 2023
79a612b
CI: @sliit-foss/automatic-versioning - sync release
github-actions[bot] May 7, 2023
753bab5
Merge branch 'main' into development
Akalanka47000 May 7, 2023
daf8190
Patch(automatic-versioning): type safety
Akalanka47000 May 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: release
description: Base package release action
inputs:
npm_token:
description: "Token to authenticate with the npm registry"
required: true
runs:
using: composite
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Configure git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
shell: bash

- run: git fetch --prune --unshallow
shell: bash

- name: Install dependencies
run: npm install -g pnpm@8 && pnpm install --production --ignore-scripts
shell: bash

- name: Create .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ inputs.npm_token }}" > .npmrc
shell: bash

- run: echo "git-checks=false" >> .npmrc
shell: bash

- name: Sync submodules
run: pnpm sync-submodules
shell: bash

- name: Populate prerequisities
run: |
echo "{ \"release_tag\": \"$TAG\" }" > cache-control.json
cd packages && for p in *; do if [ -d "$p" ]; then cp ../.npmignore ../LICENSE ../cache-control.json $p/; fi; done && cd ..
cd plugins && for p in *; do if [ -d "$p" ]; then cp ../.npmignore ../LICENSE ../cache-control.json $p/; fi; done && cd ..
shell: bash

- name: Publish packages on NPM
run: |
pnpm --filter @sliit-foss/automatic-versioning build && npm i -g ./packages/automatic-versioning
pnpm release
shell: bash

- name: Cleanup
run: rm -rf cache-control.json && rm -rf p*/**/cache-control.json
shell: bash

- name: Update release info
run: |
git config pull.ff true
git add . && git commit -m "CI: @sliit-foss/automatic-versioning - sync release" || true
git pull --rebase && git push origin
shell: bash
22 changes: 0 additions & 22 deletions .github/actions/unit-test/action.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI Prerelease
on:
push:
branches:
- development
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TAG: blizzard
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/release
with:
npm_token: ${{ secrets.NPM_TOKEN }}
42 changes: 6 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,12 @@ on:
jobs:
release:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TAG: latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: ./.github/actions/release
with:
node-version: 16

- name: Configure git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- run: git fetch --prune --unshallow

- name: Install dependencies
run: npm install -g pnpm@8 @sliit-foss/automatic-versioning@latest && pnpm install --production --ignore-scripts

- name: Create .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc

- run: echo "git-checks=false" >> .npmrc

- name: Fetch submodules
run: |
git submodule init
git submodule update

- name: Populate prerequisities
run: |
cd packages && for p in *; do if [ -d "$p" ]; then cp ../.npmignore ../LICENSE $p/; fi; done && cd ..
cd plugins && for p in *; do if [ -d "$p" ]; then cp ../.npmignore ../LICENSE $p/; fi; done && cd ..

- name: Publish package on NPM
run: pnpm release

- name: Update release info
run: |
git config pull.ff true
git add . && git commit -m "CI: @sliit-foss/automatic-versioning - sync release" || true
git pull --rebase && git push origin main
npm_token: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ on:
pull_request:
branches:
- main
- development

jobs:
unit-tests:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ p*/**/jest.config.js
p*/**/LICENSE

p*/**/node_modules/
p*/**/logs/
p*/**/logs/.turbo
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ coverage/
node_modules/
.babelrc
jest.config.js
cache-control.json
.env
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
],
"scripts": {
"build": "turbo run build",
"bump-version": "turbo run bump-version --concurrency=1",
"bump-version": "turbo run bump-version",
"dev": "turbo run dev",
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{js,ts,tsx,md}\"",
"prepare": "husky install",
"release": "turbo run release --concurrency=1",
"release": "turbo run release",
"sync-submodules": "git submodule init && git submodule update",
"test": "dotenv -- turbo run test"
},
"dependencies": {
Expand All @@ -24,7 +25,6 @@
"esbuild": "0.17.5",
"esbuild-plugin-glob": "2.2.1",
"jest": "29.4.1",
"prettier": "2.8.3",
"rimraf": "4.1.2",
"shx": "0.3.4",
"turbo": "1.7.3"
Expand All @@ -36,7 +36,8 @@
"eslint": "8.33.0",
"eslint-config-turbo": "0.0.7",
"husky": "8.0.3",
"nodemon": "2.0.21"
"nodemon": "2.0.21",
"prettier": "2.8.3"
},
"engines": {
"node": ">=14.0.0"
Expand Down
64 changes: 32 additions & 32 deletions packages/actions-exec-wrapper/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"name": "@sliit-foss/actions-exec-wrapper",
"version": "1.1.1",
"description": "A wrapper around the @actions/exec module which promisifies the console output of a command",
"main": "dist/index.js",
"scripts": {
"build": "node ../../scripts/esbuild.config.js",
"build:watch": "bash ../../scripts/esbuild.watch.sh",
"bump-version": "pnpm build && npx automatic-versioning --name=@sliit-foss/actions-exec-wrapper --no-commit --recursive",
"lint": "bash ../../scripts/lint.sh",
"release": "bash ../../scripts/release.sh",
"test": "bash ../../scripts/test/test.sh"
},
"dependencies": {
"@actions/exec": "1.1.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sliit-foss/npm-catalogue.git"
},
"keywords": [
"@actions/exec",
"actions-exec-wrapper",
"console-output"
],
"author": "SLIIT FOSS",
"license": "MIT",
"bugs": {
"url": "https://github.com/sliit-foss/npm-catalogue/issues"
},
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/packages/actions-exec-wrapper/readme.md"
}
{
"name": "@sliit-foss/actions-exec-wrapper",
"version": "1.1.1",
"description": "A wrapper around the @actions/exec module which promisifies the console output of a command",
"main": "dist/index.js",
"scripts": {
"build": "node ../../scripts/esbuild.config.js",
"build:watch": "bash ../../scripts/esbuild.watch.sh",
"bump-version": "bash ../../scripts/bump-version.sh --name=@sliit-foss/actions-exec-wrapper",
"lint": "bash ../../scripts/lint.sh",
"release": "bash ../../scripts/release.sh",
"test": "bash ../../scripts/test/test.sh"
},
"dependencies": {
"@actions/exec": "1.1.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sliit-foss/npm-catalogue.git"
},
"keywords": [
"@actions/exec",
"actions-exec-wrapper",
"console-output"
],
"author": "SLIIT FOSS",
"license": "MIT",
"bugs": {
"url": "https://github.com/sliit-foss/npm-catalogue/issues"
},
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/packages/actions-exec-wrapper/readme.md"
}
4 changes: 2 additions & 2 deletions packages/automatic-versioning/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@sliit-foss/automatic-versioning",
"version": "1.2.1",
"version": "1.4.3-blizzard.1",
"description": "A script which will automatically increment your app package version in accordance with conventional commits",
"main": "dist/index.js",
"bin": "dist/index.js",
"scripts": {
"build": "node ../../scripts/esbuild.config.js",
"build:watch": "bash ../../scripts/esbuild.watch.sh",
"bump-version": "pnpm build && node dist/index.js --no-commit --recursive",
"bump-version": "bash ../../scripts/bump-version.sh",
"lint": "bash ../../scripts/lint.sh",
"release": "bash ../../scripts/release.sh",
"test": "dotenv -- jest --coverage --verbose --runInBand --forceExit"
Expand Down
46 changes: 37 additions & 9 deletions packages/automatic-versioning/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,34 +93,62 @@ yarn bump-version
- Fix - bump patch version
```

## Disable version bumping for specific commit<br/><br/>
## Disable commit <br/>

- Add the following to your commit message: "--no-bump"<br/>
- By default automatic-versioning will commit the newly incremented version to source control. To disable this behavior, add the following to your script: "--no-commit"<br/>

```bash
npx automatic-versioning --name=<package_name> --no-commit
```

## Disable version bumping for specific commit<br/>

```bash
git commit -m "Feat: some feature --no-bump"
```

## Disable --no-bump commit message edit <br/><br/>
## Disable --no-bump commit message edit <br/>

- By default automatic-versioning will edit the commit message in no-bump commits and remove the no-bump part from the commit message. Sometimes such as in the case of monorepos, this can prove to be a problem. To disable this behavior, add the following to your script: "--no-commit-edit"<br/>

```bash
npx automatic-versioning --name=<package_name> --no-commit-edit
```

## Custom app directory to run incrementing script<br/><br/>

- Add the following option to your bump script: "--rootDir=<custom_dir>"<br/>
## Custom app directory to run incrementing script<br/>

```bash
npx automatic-versioning --name=<package_name> --rootDir=<custom_dir>
```

## Recursively search commit history to find version bump trigger<br/><br/>

- Add the following option to your bump script: "--recursive"<br/>
## Recursively search commit history to find version bump trigger<br/>

```bash
npx automatic-versioning --name=<package_name> --recursive
```

## Custom prerelease tag<br/>

```bash
npx automatic-versioning --name=<package_name> --prerelease-tag=<name>
```

## Prerelease branch<br/>

- If this option is specified and the current branch matches it, the versioning will be evaluated as follows <br/>

- Feat! --> Premajor
- Feat --> Preminor
- Fix --> Prepatch

```bash
npx automatic-versioning --name=<package_name> --prerelease-branch=<branch_name>
```

## Ignore prefixes<br/>

- A list of comma separated prefixes to ignore when evaluating the commit message. By default we stop searching for commits once we come across any prefix considered by commitlint as valid prefixes. You can use this option to ignore a few of them if the need arises<br/>

```bash
npx automatic-versioning --name=<package_name> --ignore-prefixes=ci,docs
```