From 32831a1d88ff4b21461fae1649d13342cb39c881 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 May 2024 20:52:07 -0600 Subject: [PATCH] Release 0.7.0 (#6) Attach artifacts to release --- .github/workflows/ci-build-release.yml | 29 +++++++++++++++++++------- .github/workflows/release-notes.yml | 7 ++++--- CHANGELOG.md | 9 ++++++-- build.clj | 4 ++++ resources/VERSION | 2 +- 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-build-release.yml b/.github/workflows/ci-build-release.yml index 09d4bfe..3ea5a6e 100644 --- a/.github/workflows/ci-build-release.yml +++ b/.github/workflows/ci-build-release.yml @@ -51,8 +51,7 @@ jobs: release: runs-on: ubuntu-latest needs: build - if: startsWith(github.event.head_commit.message, 'Release') - # && github.ref == 'refs/heads/main' + if: startsWith(github.event.head_commit.message, 'Release') && github.ref == 'refs/heads/main' steps: - name: Checkout code uses: actions/checkout@v4 @@ -65,6 +64,8 @@ jobs: id: generate_release_notes run: echo "${{ github.event.head_commit.message }}" > RELEASE_NOTES.md + # note the artifacts are folders containing artifact + # eg: target/clj-mergetool-linux-amd64/clj-merge-tool - name: Download build artifacts for Linux amd64 uses: actions/download-artifact@v4 with: @@ -101,17 +102,29 @@ jobs: name: clj-mergetool-macos-latest-arm64 path: target/clj-mergetool-macos-arm64 + - name: Display structure of downloaded files + run: ls -R target + + - name: Rename artifacts + run: | + mv target/clj-mergetool-linux-amd64/clj-mergetool clj-mergetool-linux-amd64 + mv target/clj-mergetool-linux-arm64/clj-mergetool clj-mergetool-linux-arm64 + mv target/clj-mergetool-windows-amd64.exe/clj-mergetool.exe clj-mergetool-windows-amd64.exe + mv target/clj-mergetool-windows-arm64.exe/clj-mergetool.exe clj-mergetool-windows-arm64.exe + mv target/clj-mergetool-macos-amd64/clj-mergetool clj-mergetool-macos-amd64 + mv target/clj-mergetool-macos-arm64/clj-mergetool clj-mergetool-macos-arm64 + - name: Create Release uses: softprops/action-gh-release@v1 with: tag_name: ${{ steps.read_tag.outputs.tag }} body_path: RELEASE_NOTES.md files: | - target/clj-mergetool-linux-amd64 - target/clj-mergetool-linux-arm64 - target/clj-mergetool-windows-amd64.exe - target/clj-mergetool-windows-arm64.exe - target/clj-mergetool-macos-amd64 - target/clj-mergetool-macos-arm64 + clj-mergetool-linux-amd64 + clj-mergetool-linux-arm64 + clj-mergetool-windows-amd64.exe + clj-mergetool-windows-arm64.exe + clj-mergetool-macos-amd64 + clj-mergetool-macos-arm64 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index c523f9a..2165e77 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -37,7 +37,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git checkout -b release-notes-branch clojure -T:build release-version - git push origin release-notes-branch - gh pr create --title "Release Notes Update" --body "This PR contains the updated release notes" --base main --head release-notes-branch + VERSION=$(cat resources/VERSION) + NOTES=$(cat RELEASE_NOTES.md) + git push origin HEAD:release-$VERSION + gh pr create --title "Release $VERSION" --body "$NOTES" --base main --head release-$VERSION diff --git a/CHANGELOG.md b/CHANGELOG.md index ddd9d26..3d70bee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ # Change Log -## 0.7.0 - [Unreleased] +## 0.8.0 - [Unreleased] ... +## [0.7.0] - 2024-05-20 + +Attach artifacts to release + ## [0.6.1] - 2024-05-19 Fix release permission @@ -67,7 +71,8 @@ Initial release --- -[Unreleased]: https://github.com/kurtharriger/clj-mergetool/compare/0.6.1...HEAD +[Unreleased]: https://github.com/kurtharriger/clj-mergetool/compare/0.7.0...HEAD +[0.7.0]: https://github.com/kurtharriger/clj-mergetool/compare/0.6.1...0.7.0 [0.6.1]: https://github.com/kurtharriger/clj-mergetool/compare/0.6.0...0.6.1 [0.6.0]: https://github.com/kurtharriger/clj-mergetool/compare/0.5.0...0.6.0 [0.5.0]: https://github.com/kurtharriger/clj-mergetool/compare/0.4.3...0.5.0 diff --git a/build.clj b/build.clj index 845c953..e80e8a5 100644 --- a/build.clj +++ b/build.clj @@ -111,6 +111,10 @@ updated-changelog (-> changelog (string/replace unreleased-header (str next-version-header "\n\n...\n\n" release-header)) (string/replace unreleased-link (str next-unreleased-link "\n" release-link)))] + (when (= "..." changes) + (binding [*out* *err*] + (println "Change log not updated") + (System/exit 1))) (spit "resources/VERSION" release-version) (spit changelog-path updated-changelog) (shell "git" "add" "resources/VERSION" "CHANGELOG.md") diff --git a/resources/VERSION b/resources/VERSION index 7ceb040..bcaffe1 100644 --- a/resources/VERSION +++ b/resources/VERSION @@ -1 +1 @@ -0.6.1 \ No newline at end of file +0.7.0 \ No newline at end of file