From 857ac49a57fd8a09f6ffc7b8c141aa23b4f34df5 Mon Sep 17 00:00:00 2001 From: Big Andy <8012398+big-andy-coates@users.noreply.github.com> Date: Thu, 3 Nov 2022 20:44:25 +0000 Subject: [PATCH] Looking good --- .github/release.yml | 3 +++ .github/workflows/build.yml | 17 ++++------------- .github/workflows/codeql.yml | 2 -- .github/workflows/release-notes.yml | 21 --------------------- .github/workflows/version.yml | 10 ++++++++-- 5 files changed, 15 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/release-notes.yml diff --git a/.github/release.yml b/.github/release.yml index 7e2d04f..2205c81 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -13,5 +13,8 @@ changelog: - title: Bug Fixes 🎉 labels: [ bug ] + - title: Dependency Updates + labels: [ dependencies ] + - title: Less Exciting Things labels: [ "*" ] \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 288d777..6fd476d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,11 +5,8 @@ name: Build on: push: - branches: [ not-main ] # todo: -# tags: -# - v* - # - v*.*.* - # todo - !*-alpha + branches: [ main ] + tags: [ "v*.*.*" ] pull_request: branches: [ main ] workflow_dispatch: @@ -17,8 +14,6 @@ on: publish_artifacts: description: "Publish release artifacts: true or false?" default: "true" - schedule: - - cron: '0 0 * * 0' jobs: build-code: @@ -48,18 +43,14 @@ jobs: git fetch --tags --unshallow ./gradlew publish closeSonatypeStagingRepository - # Todo: build-release: - # if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-alpha') runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v3.1.0 - - name: Hack - run: | - echo "github.ref: ${{ github.ref }}" - - name: Release + - name: Create GitHut Release uses: softprops/action-gh-release@v1 with: generate_release_notes: true \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2f86633..9d1b775 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,8 +1,6 @@ name: CodeQL on: - push: - branches: [ not-main ] # todo: pull_request: branches: [ main ] diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml deleted file mode 100644 index 6985790..0000000 --- a/.github/workflows/release-notes.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Build Release Notes - -on: - push: - tags: [ "v*.*.*" ] - -jobs: - build-release: - if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-alpha') - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v3.1.0 - - name: Create GitHut Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - generate_release_notes: true - -# Todo: Merge into build.yml and drop this file. \ No newline at end of file diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index f45fb54..d47f5ee 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -1,12 +1,12 @@ # A Workflow for adjusting the version number of the next release -name: Version +name: Set next version on: workflow_dispatch: inputs: part: - description: "Part to increment: Major, Minor or Patch" + description: "Part to increment: Major, Minor, Patch or the next release, e.g. 1.2.3" required: true default: Minor @@ -29,7 +29,13 @@ jobs: - name: Fetch all tags run: git fetch --tags --unshallow - name: Increment version + if: contains(fromJson('["Major", "Minor", "Patch"]'), github.event.inputs.part) run: | # The following command will trigger the build.yml workflow as it pushes a alpha tag ./gradlew markNextVersion -Prelease.incrementer=increment${{ github.event.inputs.part }} + - name: Set next version + if: !contains(fromJson('["Major", "Minor", "Patch"]'), github.event.inputs.part) + run: | + # The following command will trigger the build.yml workflow as it pushes a alpha tag + ./gradlew markNextVersion -Prelease.version=${{ github.event.inputs.part }}