-
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.
feat: setup semantic-release for automated releases
- Loading branch information
1 parent
81b17f1
commit a09065b
Showing
18 changed files
with
2,896 additions
and
330 deletions.
There are no files selected for viewing
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,11 @@ | ||
name: Analyze Commit Messages | ||
on: | ||
pull_request: | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
jobs: | ||
analyze-commits: | ||
name: Generate docs and coverage report | ||
uses: fingerprintjs/dx-team-toolkit/.github/workflows/analyze-commits.yml@v1 |
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,12 @@ | ||
name: ci | ||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
build-and-check: | ||
name: Build project and run CI checks | ||
uses: fingerprintjs/dx-team-toolkit/.github/workflows/build-typescript-project.yml@v1 |
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,12 @@ | ||
name: Check coverage for PR | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
run-tests-check-coverage: | ||
name: Run tests & check coverage | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
uses: fingerprintjs/dx-team-toolkit/.github/workflows/coverage-diff.yml@v1 |
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,15 @@ | ||
name: Generate docs and coverage report | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
generate-docs-and-coverage: | ||
name: Generate docs and coverage report | ||
uses: fingerprintjs/dx-team-toolkit/.github/workflows/docs-and-coverage.yml@v1 | ||
with: | ||
skip-docs-step: true | ||
prepare-gh-pages-commands: | | ||
mv coverage/lcov-report ./gh-pages/coverage |
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,117 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
prerelease: | ||
description: 'Create a pre-release' | ||
default: 'false' | ||
required: false | ||
type: boolean | ||
version_bump: | ||
description: 'A type of version bump' | ||
default: 'patch' | ||
required: true | ||
type: choice | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
|
||
jobs: | ||
release: | ||
name: Release Azure integration distribution | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
if: github.ref == 'refs/heads/develop' | ||
|
||
steps: | ||
- name: Checkout develop branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: develop | ||
fetch-depth: 0 | ||
|
||
- name: Install node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
|
||
- name: Set git settings | ||
uses: fregante/setup-git-user@v1 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Run tests | ||
run: yarn test | ||
|
||
- name: Disable version tags | ||
run: yarn config set version-git-tag false | ||
|
||
- name: Bump version | ||
run: yarn version --${{ github.event.inputs.version_bump }} | ||
|
||
- name: Build functions | ||
run: yarn build | ||
env: | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
FPCDN: fpcdn.io | ||
INGRESS_API: api.fpjs.io | ||
IS_RELEASE_BUILD: true | ||
|
||
- name: Get new version of function | ||
id: new_version | ||
uses: notiz-dev/[email protected] | ||
with: | ||
path: 'package.json' | ||
prop_path: 'version' | ||
|
||
- name: Prepare a package | ||
run: | | ||
cd dist | ||
zip -r package.zip * | ||
mv package.zip ../ | ||
cd ../ | ||
cp package.zip v${{steps.new_version.outputs.prop}}.zip | ||
- name: Commit and push new version of lambda | ||
run: | | ||
git commit package.json -m "chore: release v${{steps.new_version.outputs.prop}}" | ||
git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" | ||
git tag -a "v${{steps.new_version.outputs.prop}}" -m "v${{steps.new_version.outputs.prop}}" | ||
git push --tags "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" | ||
## Prepare a release | ||
- name: Create a Github release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: v${{steps.new_version.outputs.prop}} | ||
name: v${{steps.new_version.outputs.prop}} | ||
draft: true | ||
prerelease: ${{ github.event.inputs.prerelease }} | ||
artifacts: v${{steps.new_version.outputs.prop}}.zip,package.zip | ||
artifactContentType: 'application/zip' | ||
generateReleaseNotes: true | ||
|
||
- name: Create Pull Request from develop to main | ||
id: create_pr | ||
uses: devops-infra/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
source_branch: develop | ||
target_branch: main | ||
title: v${{ steps.new_version.outputs.prop }} | ||
body: New version of scripts v${{ steps.new_version.outputs.prop }} | ||
label: release | ||
|
||
- name: Check PR outputs | ||
if: ${{ steps.create_pr.outputs.url }} | ||
run: echo "Pull Request URL - ${{ steps.create_pr.outputs.url }}" |
Oops, something went wrong.