Skip to content

Commit

Permalink
ci(pre-release): pre-release ci (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpierre74 authored Mar 19, 2022
1 parent 53b5ac7 commit 115e63a
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 25 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,35 @@ name: 'Forms Pre-release'
on:
workflow_dispatch:
inputs:
branch:
description: Specify the git branch you want to prerelease
required: true
type: string
pre_id:
description: "Specify the pre-id parameter for your pre-release (e.g. 'alpha' or a branch name)"
required: false
description: Specify the pre-id parameter for your pre-release (e.g. 'alpha' or a branch name)
required: true
type: string

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- uses: actions/setup-node@v2
with:
cache: yarn
node-version: "14"
registry-url: https://registry.npmjs.org
- run: yarn install --frozen-lockfile --non-interactive --no-progress --prefer-offline
- name: Lint
run: yarn nx affected:lint --base=${{ github.ref }}
- name: Setup git user to "🤖 Release Bot"
run: git config user.email "-" && git config user.name "🤖 Release Bot"
- id: lowercase-branch-tag
- id: lowercase-preid
uses: ASzc/change-string-case-action@v2
with:
string: ${{ inputs.pre_id || github.ref }}
string: ${{ github.event.inputs.pre_id }}
- name: Version
id: version
env:
Expand All @@ -39,5 +41,5 @@ jobs:
# like NPM_CONFIG_REGISTRY so npm publish ends up ignoring the .npmrc file
# which is set up by `setup-node` action.
# run: npx nx affected --base=master --releaseAs=minor --target=version
run: npx --no-install nx run workspace:pre-version --baseBranch=${{ github.ref }} --syncVersions --preid=${{ steps.lowercase-branch-tag.outputs.lowercase }} --dry-run
run: npx --no-install nx run workspace:pre-version --baseBranch=${{ github.event.inputs.branch }} --syncVersions --releaseAs=prerelease --preid=${{ steps.lowercase-preid.outputs.lowercase }}

5 changes: 3 additions & 2 deletions libs/form-builder/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
"access": "public"
}
},
"publish-canary": {
"publish-dev": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"access": "public"
"access": "public",
"tag": "dev"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions libs/form-builder/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface DeFaultRulesNames {
[key: string]: string;
}

// TODO: only restrict rules used with form-validation-rule-list
export const DEFAULT_RULES_NAMES: DeFaultRulesNames = {
min: 'min',
max: 'max',
Expand Down
5 changes: 3 additions & 2 deletions libs/form-context/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@
"access": "public"
}
},
"publish-canary": {
"publish-dev": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"access": "public"
"access": "public",
"tag": "dev"
}
}
},
Expand Down
5 changes: 3 additions & 2 deletions libs/form-editor/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
"access": "public"
}
},
"publish-canary": {
"publish-dev": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"access": "public"
"access": "public",
"tag": "dev"
}
}
},
Expand Down
5 changes: 3 additions & 2 deletions libs/form-redux/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@
"access": "public"
}
},
"publish-canary": {
"publish-dev": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"access": "public"
"access": "public",
"tag": "dev"
}
}
},
Expand Down
5 changes: 3 additions & 2 deletions libs/form-validation-rule-list/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
"access": "public"
}
},
"publish-canary": {
"publish-dev": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"access": "public"
"access": "public",
"tag": "dev"
}
}
},
Expand Down
14 changes: 7 additions & 7 deletions project.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
"push": true,
"commitMessageFormat": "release(${projectName}): publish pre-release version ${version}",
"postTargets": [
"form-builder:canary-publish",
"form-validation-rule-list:canary-publish",
"form-redux:canary-publish",
"form-editor:canary-publish",
"form-context:canary-publish"
"form-builder:publish-dev",
"form-validation-rule-list:publish-dev",
"form-redux:publish-dev",
"form-editor:publish-dev",
"form-context:publish-dev"
],
"skipProjectChangelog": false,
"skipRootChangelog": false
"skipProjectChangelog": true,
"skipRootChangelog": true
}
},
"github": {
Expand Down

0 comments on commit 115e63a

Please sign in to comment.