diff --git a/.gitea/semantic_release.toml b/.gitea/semantic_release.toml new file mode 100644 index 0000000..96f7d56 --- /dev/null +++ b/.gitea/semantic_release.toml @@ -0,0 +1,37 @@ +[tool.semantic_release.branches.main] +match = "(main)" +prerelease = false + +[tool.semantic_release.commit_author] +env = "GIT_COMMIT_AUTHOR" +default = "semantic-release " + +[tool.semantic_release.commit_parser_options] +allowed_tags = [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "style", + "refactor", + "test", +] +minor_tags = ["feat"] +patch_tags = ["fix", "perf"] +default_bump_level = 0 + +[tool.semantic_release.remote] +name = "origin" +type = "gitea" +domain = "https://gitea.psi.ch" +ignore_token_for_push = false + +[tool.semantic_release.remote.token] +env = "GITHUB_TOKEN" + +[tool.semantic_release.publish] +dist_glob_patterns = ["dist/*"] +upload_to_vcs_release = true diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..ee038c0 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,28 @@ +name: release +on: + push: + branches: + - main + - feat/release_actions + +permissions: + contents: read + +jobs: + release: + name: 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 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: run_release + env: + GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} + run: pipx run python-semantic-release -c .gitea/semantic_release.toml version \ No newline at end of file diff --git a/copier.yml b/copier.yml index 592ce9e..944f339 100644 --- a/copier.yml +++ b/copier.yml @@ -1,3 +1,6 @@ +_exclude: + - ".gitea/" + # predefined values # make sure these have 'when: false' so that the questions are not asked and the items are not saved in answers.yml