Skip to content

Commit

Permalink
ci: setup semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoporto committed Jan 14, 2025
1 parent 54a8dfd commit 51cae52
Show file tree
Hide file tree
Showing 7 changed files with 1,381 additions and 28 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
name: Release
name: Release Package

on: workflow_dispatch

jobs:
generate-release:
name: Generate Release
runs-on: ubuntu-latest
# checks:
# uses: ./.github/workflows/checks.yml
# secrets: inherit
# unit_tests:
# uses: ./.github/workflows/unit-tests.yml
# secrets: inherit

release:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
attestations: write
# needs: [checks, unit_tests]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -23,5 +35,12 @@ jobs:
- name: Install Dependencies
run: pnpm install --frozen-lockfile --ignore-scripts

# - name: Bump version, create commit, add tag, push commit and publish github release
# run: pnpm release
- name: Bump version, add tag, and publish github release
run: pnpm --filter gerador-validador-cpf release:dry-run

- name: Remove node_modules
run: rm -rf packages/gerador-validador-cpf/node_modules/

- uses: actions/attest-build-provenance@v2
with:
subject-path: '${{ github.workspace }}/packages/gerador-validador-cpf'
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
access=public
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Read in other languages: [English](/~https://github.com/tiagoporto/gerador-validad
![Website](https://img.shields.io/website?logo=githubpages&style=flat-square&url=https://tiagoporto.github.io/gerador-validador-cpf)
[![W3C Validation](https://img.shields.io/w3c-validation/html.svg?style=flat-square&targetUrl=https://tiagoporto.github.io/gerador-validador-cpf/)](https://validator.nu/?doc=https%3A%2F%2Ftiagoporto.github.io%2Fgerador-validador-cpf)
[![Docs GA Workflow Status](https://img.shields.io/github/actions/workflow/status/tiagoporto/gerador-validador-cpf/check-docs.yml?label=docs&logo=githubactions&logoColor=white&style=flat-square)](/~https://github.com/tiagoporto/gerador-validador-cpf/actions/workflows/check-docs.yml)
[![Lint GA Workflow Status](https://img.shields.io/github/actions/workflow/status/tiagoporto/gerador-validador-cpf/lint.yml?label=lint&logo=githubactions&logoColor=white&style=flat-square)](/~https://github.com/tiagoporto/gerador-validador-cpf/actions/workflows/lint.yml)
[![Checks GA Workflow Status](https://img.shields.io/github/actions/workflow/status/tiagoporto/gerador-validador-cpf/checks.yml?label=checks&logo=githubactions&logoColor=white&style=flat-square)](/~https://github.com/tiagoporto/gerador-validador-cpf/actions/workflows/checks.yml)
[![Tests GA Workflow Status](https://img.shields.io/github/actions/workflow/status/tiagoporto/gerador-validador-cpf/unit-tests.yml?label=unit%20tests&logo=githubactions&logoColor=white&style=flat-square)](/~https://github.com/tiagoporto/gerador-validador-cpf/actions/workflows/unit-tests.yml)
[![Coverage Status](https://img.shields.io/coverallsCoverage/github/tiagoporto/gerador-validador-cpf.svg?logo=coveralls&style=flat-square)](https://coveralls.io/github/tiagoporto/gerador-validador-cpf)
[![E2E Tests GA Workflow Status](https://img.shields.io/github/actions/workflow/status/tiagoporto/gerador-validador-cpf/e2e-tests.yml?label=e2e%20tests&logo=githubactions&logoColor=white&style=flat-square)](/~https://github.com/tiagoporto/gerador-validador-cpf/actions/workflows/e2e-tests.yml)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
"eslint-plugin-markdown>eslint": ">=9",
"react-copy-to-clipboard>react": ">=19",
"react-ga>react": ">=19",
"react-helmet-async>react": ">=19"
"react-helmet-async>react": ">=19",
"conventional-changelog-conventionalcommits": ">=8.0.0"
}
}
}
22 changes: 22 additions & 0 deletions packages/gerador-validador-cpf/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"branches": [
"main",
{
"name": "alpha",
"channel": "alpha",
"prerelease": true
},
{
"name": "beta",
"channel": "beta",
"prerelease": true
}
],
"preset": "conventionalcommits",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@anolilab/semantic-release-pnpm",
"@semantic-release/github"
]
}
15 changes: 8 additions & 7 deletions packages/gerador-validador-cpf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gerador-validador-cpf",
"version": "6.0.0-alpha.1",
"version": "0.0.0-development",
"description": "Biblioteca JS para gerar e validar CPF (Cadastro de Pessoas Físicas) do Brasil.",
"homepage": "https://tiagoporto.github.io/gerador-validador-cpf",
"keywords": [
Expand All @@ -12,10 +12,7 @@
"valida",
"validates"
],
"author": {
"name": "Tiago Porto",
"url": "https://tiagoporto.com"
},
"author": "Tiago Porto (https://www.tiagoporto.com)",
"repository": {
"type": "git",
"url": "git+/~https://github.com/tiagoporto/gerador-validador-cpf.git",
Expand All @@ -42,15 +39,19 @@
"license": "MIT",
"scripts": {
"prepack": "pnpm build",
"build": "rm -rf dist && rollup --config"
"build": "rm -rf dist && rollup --config",
"release": "semantic-release",
"release:dry-run": "semantic-release --dry-run --verify-conditions false"
},
"dependencies": {
"tslib": "^2.8.1"
},
"devDependencies": {
"rollup": "^4.29.1",
"@anolilab/semantic-release-pnpm": "^1.1.6",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.2",
"rollup": "^4.30.1",
"semantic-release": "^24.2.1",
"typescript": "^5.7.2"
}
}
Loading

0 comments on commit 51cae52

Please sign in to comment.