From 6280d322d5edfa5184b9091e4c3375fe5334fe37 Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Sat, 23 Mar 2024 17:41:57 +0100 Subject: [PATCH 1/2] ci: add GitHub actions for PR check and release --- .github/workflows/check.yml | 12 ++++++ .github/workflows/release.yml | 77 +++++++++++++++++++++++++++++++++++ .releaserc.yml | 17 ++++++++ 3 files changed, 106 insertions(+) create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/release.yml create mode 100644 .releaserc.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..8eb8edf --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,12 @@ +name: Check + +on: + pull_request: + branches: + - main + +jobs: + check: + uses: wetransform/gha-workflows/.github/workflows/gradle-library-check.yml@master + with: + java-version: 11 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..28e709b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,77 @@ +--- +name: Release + +"on": + workflow_dispatch: + push: + branches: [main] + +env: + # renovate: datasource=npm depName=@semantic-release/changelog + SEMANTIC_RELEASE_CHANGELOG_VERSION: 6.0.3 + + # renovate: datasource=npm depName=@semantic-release/exec + SEMANTIC_RELEASE_EXEC_VERSION: 6.0.3 + + # renovate: datasource=npm depName=@semantic-release/git + SEMANTIC_RELEASE_GIT_VERSION: 10.0.1 + + # renovate: datasource=npm depName=conventional-changelog-conventionalcommits + CONVENTIONAL_CHANGELOG_CONVENTIONALCOMMITS_VERSION: 6.1.0 + +jobs: + release: + name: Release + runs-on: ubuntu-latest + concurrency: ${{ github.workflow }}-release + + outputs: + release-published: ${{ steps.release.outputs.new_release_published }} + release-version: ${{ steps.release.outputs.new_release_version }} + + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + persist-credentials: false + + - name: Setup Java + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + with: + distribution: temurin + java-version: 11 + + - name: Setup Gradle + uses: gradle/gradle-build-action@87a9a15658c426a54dd469d4fc7dc1a73ca9d4a6 # v2.10.0 + + - name: Release + id: release + uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4 # v4.0.0 + env: + # Permissions needed + # contents: write + # issues: write + # pull-requests: write + GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }} + GIT_AUTHOR_NAME: wetransform Bot + GIT_AUTHOR_EMAIL: 113353961+wetransformer@users.noreply.github.com + GIT_COMMITTER_NAME: wetransform Bot + GIT_COMMITTER_EMAIL: 113353961+wetransformer@users.noreply.github.com + RUNNER_DEBUG: 1 + # For Gradle execution + ORG_GRADLE_PROJECT_gradle.publish.key: ${{ secrets.GRADLE_PUBLISH_KEY }} + ORG_GRADLE_PROJECT_gradle.publish.secret: ${{ secrets.GRADLE_PUBLISH_SECRET }} + with: + # dry_run: true + semantic_version: 21.1.2 + + extra_plugins: + "@semantic-release/changelog@\ + ${{ env.SEMANTIC_RELEASE_CHANGELOG_VERSION }} \ + @semantic-release/exec@\ + ${{ env.SEMANTIC_RELEASE_EXEC_VERSION }} \ + @semantic-release/git@\ + ${{ env.SEMANTIC_RELEASE_GIT_VERSION }} \ + conventional-changelog-conventionalcommits@\ + ${{ env.CONVENTIONAL_CHANGELOG_CONVENTIONALCOMMITS_VERSION }} \ + " diff --git a/.releaserc.yml b/.releaserc.yml new file mode 100644 index 0000000..cfb5a44 --- /dev/null +++ b/.releaserc.yml @@ -0,0 +1,17 @@ +--- +preset: conventionalcommits +branches: main + +plugins: + # https://github.com/semantic-release/commit-analyzer?tab=readme-ov-file#configuration + - - "@semantic-release/commit-analyzer" + - - "@semantic-release/release-notes-generator" + - "@semantic-release/changelog" + - - "@semantic-release/exec" + - publishCmd: ./gradlew publishPlugins + # prepareCmd: echo "${nextRelease.version}" > version.txt # TODO set via plugin + - - "@semantic-release/git" + - assets: + - CHANGELOG.md + # - version.txt + - "@semantic-release/github" From e2a5b30e52b02865b9ad8325b37f31f31d2de1cb Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Sat, 23 Mar 2024 17:42:16 +0100 Subject: [PATCH 2/2] chore: prepare initial release --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ec39bb8..266d8fd 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ java { } group = "to.wetransform" -version = "1.0.0-SNAPSHOT" +version = "1.0.0" dependencies { implementation 'org.ajoberstar.grgit:grgit-core:5.2.2'