From 3cc7069fbde5cd79714764bc506c3b0a1807c3c2 Mon Sep 17 00:00:00 2001 From: Jason Ernst Date: Fri, 16 Jun 2023 15:28:50 -0700 Subject: [PATCH] 1.0.7 staging (#133) * rename workflow jobs, make test only run on PRs (#128) * Added a workflow to run on tag creation * don't need to create a release because that's how we'll be creating tags * Update the tag workflow to prepend the changelog to the CHANGELOG.md file * Create CHANGELOG.md * chore: Update CHANGELOG.md * added a trigger for tag so that initial dev deploy is run on tag * chore: Update CHANGELOG.md * fix syntax * added excludes for the changelog * still trying at triggering on tags * chore: Update CHANGELOG.md * Added semver override to fix zero version issue * forgot to define semver * chore: Update CHANGELOG.md * rename workflow jobs, make test only run on PRs (#128) (#129) (#132) --------- Co-authored-by: compscidr --- .github/workflows/publish-dev.yml | 2 ++ .github/workflows/tag.yml | 42 +++++++++++++++++++++++++++++++ CHANGELOG.md | 33 ++++++++++++++++++++++++ app/build.gradle | 5 +++- 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tag.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index db2b562..2b180df 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -4,6 +4,8 @@ on: push: branches: - main + # triggers on tag creation + create: jobs: deploy-dev: diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000..785d50f --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,42 @@ +name: Create Release + +on: + push: + tags: + - '*' + +jobs: + create-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Create changelog text + id: changelog + uses: loopwerk/tag-changelog@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + exclude: other,doc,chore,build + + # based off example here: https://github.com/loopwerk/tag-changelog/commit/20ca6a4b3f21b7feade68bea88f5cce5bbbdc4b7 + - name: Read CHANGELOG.md + id: readfile + uses: juliangruber/read-file-action@v1 + with: + path: ./CHANGELOG.md + + - name: Write to CHANGELOG.md + uses: DamianReeves/write-file-action@master + with: + path: ./CHANGELOG.md + contents: ${{ steps.changelog.outputs.changelog }}${{ steps.readfile.outputs.content }} + write-mode: overwrite + + - name: Commit and push CHANGELOG.md + uses: EndBug/add-and-commit@v7 + with: + add: CHANGELOG.md + message: "chore: Update CHANGELOG.md" + branch: main \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..59f6b50 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,33 @@ +# 1.0.7 - 2023-06-16 + +## Chores +- Update CHANGELOG.md + +## Other Changes +- Added semver override to fix zero version issue +- forgot to define semver + +# 1.0.6 - 2023-06-16 + +## Chores +- Update CHANGELOG.md + +## Other Changes +- fix syntax +- Merge branch 'main' of github.com:compscidr/hello-kotlin-android +- added excludes for the changelog +- still trying at triggering on tags + +# 1.0.5 - 2023-06-16 + +## Chores +- Update CHANGELOG.md + +## Other Changes +- added a trigger for tag so that initial dev deploy is run on tag +- Merge branch 'main' of github.com:compscidr/hello-kotlin-android + +# 1.0.4 - 2023-06-16 + +## Other Changes +- Create CHANGELOG.md \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 647772e..ed70e16 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -158,9 +158,12 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { } // https://github.com/ReactiveCircus/app-versioning +import io.github.reactivecircus.appversioning.SemVer + appVersioning { overrideVersionCode { gitTag, providers, variantInfo -> - gitTag.commitsSinceLatestTag + def semVer = SemVer.fromGitTag(gitTag) + semVer.major * 2000000 + semVer.minor * 20000 + semVer.patch * 200 + gitTag.commitsSinceLatestTag } }