Skip to content

Commit

Permalink
Release 0.7.0 (#6)
Browse files Browse the repository at this point in the history
Attach artifacts to release
  • Loading branch information
github-actions[bot] authored May 20, 2024
1 parent 8d55e9a commit 32831a1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 14 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/ci-build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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 }}
7 changes: 4 additions & 3 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion resources/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.1
0.7.0

0 comments on commit 32831a1

Please sign in to comment.