From 2027edce05ba54a0febec279fbf6459d388347e0 Mon Sep 17 00:00:00 2001 From: Kurt Harriger Date: Sun, 19 May 2024 07:31:31 -0600 Subject: [PATCH] add release notes --- .github/workflows/ci-build-release.yml | 112 ++++++++++++++++++------- 1 file changed, 84 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci-build-release.yml b/.github/workflows/ci-build-release.yml index 560dc54..36f1a2b 100644 --- a/.github/workflows/ci-build-release.yml +++ b/.github/workflows/ci-build-release.yml @@ -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] @@ -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 @@ -26,8 +71,6 @@ 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 @@ -35,13 +78,28 @@ jobs: 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: @@ -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 @@ -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