Skip to content

Commit

Permalink
add release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtharriger committed May 19, 2024
1 parent 713ed50 commit 2027edc
Showing 1 changed file with 84 additions and 28 deletions.
112 changes: 84 additions & 28 deletions .github/workflows/ci-build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,47 @@ on:
workflow_dispatch:

jobs:
release-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Clojure CLI and Babashka
uses: DeLaGuardo/setup-clojure@12.5
with:
cli: 'latest'
bb: 'latest'

- name: Configure Git
run: |
git config --global user.name 'clj-mergetool Release Bot'
git config --global user.email 'kurtharriger@gmail.com'
- name: Run Release Version Task
run: clojure -T:build release-version

- name: Upload updated code
uses: actions/upload-artifact@v2
with:
name: updated-code
path: .

- name: Upload release notes
uses: actions/upload-artifact@v2
with:
name: release-notes
path: RELEASE_NOTES.md

build:
needs: release-version
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
Expand All @@ -17,6 +57,11 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Download updated code
uses: actions/download-artifact@v2
with:
name: updated-code

- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -26,22 +71,35 @@ jobs:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
architecture: ${{ matrix.arch }}

- name: Install Clojure CLI and Babashka
uses: DeLaGuardo/setup-clojure@12.5
with:
cli: 'latest'
bb: 'latest'

- name: Verify native-image installation on Linux and macOS
if: runner.os != 'Windows'
run: |
which native-image
native-image --version
- name: Verify native-image installation on Windows
if: runner.os == 'Windows'
run: |
where native-image
native-image --version
- name: Run CI Task
run: clojure -T:build ci

- name: List target directory contents
run: ls -la target

- name: Archive build artifact
uses: actions/upload-artifact@v2
with:
name: clj-mergetool-${{ matrix.os }}-${{ matrix.arch }}
name: clj-mergetool-${{ matrix.os }}-latest-${{ matrix.arch }}
path: target/clj-mergetool${{ matrix.os == 'windows-latest' && '.exe' || '' }}

release:
Expand Down Expand Up @@ -88,36 +146,16 @@ jobs:
name: clj-mergetool-macos-latest-arm64
path: target/clj-mergetool-macos-arm64

- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
architecture: ${{ matrix.arch }}

- name: Install Clojure CLI and Babashka
uses: DeLaGuardo/setup-clojure@12.5
- name: Download release notes
uses: actions/download-artifact@v2
with:
cli: 'latest'
bb: 'latest'

- name: Run Release Version Task
# if: github.ref == 'refs/heads/main'
run: clojure -T:build release-version

- name: Push changes
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git push origin main
name: release-notes
path: RELEASE_NOTES.md

- name: Create Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_NOTES.md
files: |
target/clj-mergetool-linux-amd64
target/clj-mergetool-linux-arm64
Expand All @@ -127,3 +165,21 @@ jobs:
target/clj-mergetool-macos-arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

push-changes:
if: github.ref == 'refs/heads/main'
needs: release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download updated code
uses: actions/download-artifact@v2
with:
name: updated-code

- name: Push changes
run: |
git push origin main

0 comments on commit 2027edc

Please sign in to comment.