From 9c5f993a8aa129ace94b6fd193e861e55f4ca4b2 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Fri, 20 Dec 2024 18:15:39 +1100 Subject: [PATCH 1/9] trying out this --- .github/workflows/cli-release.yml | 50 +++++++++++- .github/workflows/desktop-app-release.yaml | 90 +++++++++++++++++++--- 2 files changed, 124 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index fedf38ac8ddd..2575c615d631 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -2,10 +2,13 @@ on: push: tags: - "v1.*" + pull_request: + branches: + - main workflow_dispatch: concurrency: - group: ${{ github.workflow }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true name: Release CLI @@ -63,7 +66,6 @@ jobs: sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' - # Step 5: Build the project - name: Build run: | @@ -86,16 +88,56 @@ jobs: needs: [build] permissions: contents: write + pull-requests: write + if: github.event_name != 'pull_request' steps: - # Step 1: Download all build artifacts + # Step 1: Download all artifacts - name: Download all artifacts uses: actions/download-artifact@v4 with: merge-multiple: true # Step 2: Create GitHub release with artifacts - - name: Create GitHub release + - name: Create/Update GitHub release uses: ncipollo/release-action@v1 with: artifacts: "goose-*.tar.bz2" token: ${{ secrets.GITHUB_TOKEN }} + allowUpdates: true + omitBody: true + omitPrereleaseDuringUpdate: true + + pr-comment: + name: Add PR Comment + runs-on: ubuntu-latest + needs: [build] + permissions: + pull-requests: write + if: github.event_name == 'pull_request' + steps: + # Step 1: Download all artifacts + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + # Step 2: Create comment with download links + - name: Find Comment + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: Build artifacts for this PR + + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + Build artifacts for this PR are ready! + + You can download the artifacts from the "Artifacts" section of this workflow run: + https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + edit-mode: replace \ No newline at end of file diff --git a/.github/workflows/desktop-app-release.yaml b/.github/workflows/desktop-app-release.yaml index c4e87066e576..cd51533420c5 100644 --- a/.github/workflows/desktop-app-release.yaml +++ b/.github/workflows/desktop-app-release.yaml @@ -2,23 +2,32 @@ name: Desktop App Release on: push: + tags: + - "v1.*" + pull_request: branches: - - v1.0 + - main + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - build-and-bundle: + build: runs-on: macos-latest + permissions: + contents: write + pull-requests: write steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Rust - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - profile: minimal - override: true - name: Cache Cargo registry uses: actions/cache@v3 @@ -51,9 +60,6 @@ jobs: - name: copy binary run: cp target/release/goosed ui/desktop/src/bin/goosed - - - # Desktop App Steps - name: Add MacOS certs for signing and notarization run: ./add-macos-cert.sh @@ -79,8 +85,68 @@ jobs: APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - - name: Upload default - uses: actions/upload-artifact@v3 + - name: Upload artifact + uses: actions/upload-artifact@v4 with: - name: Goose.zip + name: Goose-darwin-arm64 path: ui/desktop/out/Goose-darwin-arm64/Goose.zip + + release: + name: Release + runs-on: ubuntu-latest + needs: [build] + permissions: + contents: write + pull-requests: write + if: github.event_name != 'pull_request' + steps: + # Download all artifacts + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + # Create or update release + - name: Create/Update Release + uses: ncipollo/release-action@v1 + with: + artifacts: "*.zip" + token: ${{ secrets.GITHUB_TOKEN }} + allowUpdates: true + omitBody: true + omitPrereleaseDuringUpdate: true + + pr-comment: + name: Add PR Comment + runs-on: ubuntu-latest + needs: [build] + permissions: + pull-requests: write + if: github.event_name == 'pull_request' + steps: + # Download all artifacts + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + # Create comment with download links + - name: Find Comment + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: Desktop App build artifacts + + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + Desktop App build artifacts for this PR are ready! + + You can download the artifacts from the "Artifacts" section of this workflow run: + https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + edit-mode: replace \ No newline at end of file From 69662cc4e9c33301a3a12123a6ef0da64279e0bb Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Fri, 20 Dec 2024 18:17:02 +1100 Subject: [PATCH 2/9] target pr branches correctly --- .github/workflows/cli-release.yml | 2 +- .github/workflows/desktop-app-release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 2575c615d631..b204664b1ebf 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -4,7 +4,7 @@ on: - "v1.*" pull_request: branches: - - main + - v1.0 workflow_dispatch: concurrency: diff --git a/.github/workflows/desktop-app-release.yaml b/.github/workflows/desktop-app-release.yaml index cd51533420c5..779d298f7d9d 100644 --- a/.github/workflows/desktop-app-release.yaml +++ b/.github/workflows/desktop-app-release.yaml @@ -6,7 +6,7 @@ on: - "v1.*" pull_request: branches: - - main + - v1.0 workflow_dispatch: concurrency: From b282707501ca28e44821c0b21ba7e26d10df53f3 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Fri, 20 Dec 2024 18:22:18 +1100 Subject: [PATCH 3/9] Update .github/workflows/cli-release.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index b204664b1ebf..8daf0e87ecc7 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -88,7 +88,7 @@ jobs: needs: [build] permissions: contents: write - pull-requests: write + pull_request: write if: github.event_name != 'pull_request' steps: # Step 1: Download all artifacts From b5732c9558ac69008159db0263652fe0983817dd Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Fri, 20 Dec 2024 18:31:43 +1100 Subject: [PATCH 4/9] try again --- .github/workflows/cli-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 8daf0e87ecc7..01e9618a4607 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -88,7 +88,6 @@ jobs: needs: [build] permissions: contents: write - pull_request: write if: github.event_name != 'pull_request' steps: # Step 1: Download all artifacts From 9765c1844973ea5dfb546aeb360cd9b6fcc4bf44 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Fri, 20 Dec 2024 18:33:48 +1100 Subject: [PATCH 5/9] wording changes --- .github/workflows/cli-release.yml | 3 +-- .github/workflows/desktop-app-release.yaml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 01e9618a4607..dedfe07f8334 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -135,8 +135,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | - Build artifacts for this PR are ready! - + You can download CLI binaries from here to try this pull request out: You can download the artifacts from the "Artifacts" section of this workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} edit-mode: replace \ No newline at end of file diff --git a/.github/workflows/desktop-app-release.yaml b/.github/workflows/desktop-app-release.yaml index 779d298f7d9d..4158ac9149e0 100644 --- a/.github/workflows/desktop-app-release.yaml +++ b/.github/workflows/desktop-app-release.yaml @@ -145,7 +145,7 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | - Desktop App build artifacts for this PR are ready! + Desktop App is ready to be tried from the following link: You can download the artifacts from the "Artifacts" section of this workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} From 8904bdaa1a54d8826e2540d6b0ba81435ba383a5 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Fri, 20 Dec 2024 18:40:44 +1100 Subject: [PATCH 6/9] only want the goose cli --- .github/workflows/cli-release.yml | 16 ++++++++++++---- .github/workflows/desktop-app-release.yaml | 13 +++++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index dedfe07f8334..45d3219b47d7 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -72,7 +72,7 @@ jobs: export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} cargo build --release --target $TARGET cd target/${TARGET}/release - tar -cjf goose-${TARGET}.tar.bz2 goose goosed + tar -cjf goose-${TARGET}.tar.bz2 goose echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV # Step 6: Upload artifacts @@ -135,7 +135,15 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | - You can download CLI binaries from here to try this pull request out: - You can download the artifacts from the "Artifacts" section of this workflow run: - https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + ### CLI Binaries for this PR + + The following binaries are available for testing: + + - [📦 macOS ARM64 (M1/M2)](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/goose-aarch64-apple-darwin) + - [📦 macOS x86_64 (Intel)](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/goose-x86_64-apple-darwin) + - [📦 Linux x86_64](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/goose-x86_64-unknown-linux-gnu) + + Each archive contains the `goose` CLI binary. + + You'll need to be logged into GitHub to download these artifacts. edit-mode: replace \ No newline at end of file diff --git a/.github/workflows/desktop-app-release.yaml b/.github/workflows/desktop-app-release.yaml index 4158ac9149e0..eb354f9687a5 100644 --- a/.github/workflows/desktop-app-release.yaml +++ b/.github/workflows/desktop-app-release.yaml @@ -145,8 +145,13 @@ jobs: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | - Desktop App is ready to be tried from the following link: - - You can download the artifacts from the "Artifacts" section of this workflow run: - https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + ### Desktop App for this PR + + The following build is available for testing: + + - [📱 macOS ARM64 Desktop App (Universal, signed)](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/Goose-darwin-arm64) + + The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder. + + You'll need to be logged into GitHub to download these artifacts. edit-mode: replace \ No newline at end of file From ec2523dbe19c6676b1df86c017508bf72ac54d25 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Fri, 20 Dec 2024 18:51:01 +1100 Subject: [PATCH 7/9] use zip files instead --- .github/workflows/cli-release.yml | 14 +++++++------- .github/workflows/desktop-app-release.yaml | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 45d3219b47d7..f99df9ccaa2a 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -72,8 +72,8 @@ jobs: export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} cargo build --release --target $TARGET cd target/${TARGET}/release - tar -cjf goose-${TARGET}.tar.bz2 goose - echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV + zip -j goose-${TARGET}.zip goose + echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.zip" >> $GITHUB_ENV # Step 6: Upload artifacts - name: Upload artifact @@ -100,7 +100,7 @@ jobs: - name: Create/Update GitHub release uses: ncipollo/release-action@v1 with: - artifacts: "goose-*.tar.bz2" + artifacts: "goose-*.zip" token: ${{ secrets.GITHUB_TOKEN }} allowUpdates: true omitBody: true @@ -139,11 +139,11 @@ jobs: The following binaries are available for testing: - - [📦 macOS ARM64 (M1/M2)](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/goose-aarch64-apple-darwin) - - [📦 macOS x86_64 (Intel)](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/goose-x86_64-apple-darwin) - - [📦 Linux x86_64](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/goose-x86_64-unknown-linux-gnu) + - [📦 macOS ARM64 (M1/M2)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-aarch64-apple-darwin.zip) + - [📦 macOS x86_64 (Intel)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-apple-darwin.zip) + - [📦 Linux x86_64](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-unknown-linux-gnu.zip) Each archive contains the `goose` CLI binary. - You'll need to be logged into GitHub to download these artifacts. + These links are provided by nightly.link and will work even if you're not logged into GitHub. edit-mode: replace \ No newline at end of file diff --git a/.github/workflows/desktop-app-release.yaml b/.github/workflows/desktop-app-release.yaml index eb354f9687a5..72bd69d83fad 100644 --- a/.github/workflows/desktop-app-release.yaml +++ b/.github/workflows/desktop-app-release.yaml @@ -149,9 +149,9 @@ jobs: The following build is available for testing: - - [📱 macOS ARM64 Desktop App (Universal, signed)](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/Goose-darwin-arm64) + - [📱 macOS ARM64 Desktop App (Universal, signed)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/Goose-darwin-arm64.zip) The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder. - You'll need to be logged into GitHub to download these artifacts. + This link is provided by nightly.link and will work even if you're not logged into GitHub. edit-mode: replace \ No newline at end of file From fd79ba29e82f217ebcda75a45d7b1c9118b42412 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Sat, 21 Dec 2024 16:27:34 +1100 Subject: [PATCH 8/9] don't need to release binaries just yet of cli --- .github/workflows/cli-release.yml | 62 ++++--------------------------- 1 file changed, 7 insertions(+), 55 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index f99df9ccaa2a..fedf38ac8ddd 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -2,13 +2,10 @@ on: push: tags: - "v1.*" - pull_request: - branches: - - v1.0 workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }} cancel-in-progress: true name: Release CLI @@ -66,14 +63,15 @@ jobs: sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' + # Step 5: Build the project - name: Build run: | export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} cargo build --release --target $TARGET cd target/${TARGET}/release - zip -j goose-${TARGET}.zip goose - echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.zip" >> $GITHUB_ENV + tar -cjf goose-${TARGET}.tar.bz2 goose goosed + echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV # Step 6: Upload artifacts - name: Upload artifact @@ -88,62 +86,16 @@ jobs: needs: [build] permissions: contents: write - if: github.event_name != 'pull_request' steps: - # Step 1: Download all artifacts + # Step 1: Download all build artifacts - name: Download all artifacts uses: actions/download-artifact@v4 with: merge-multiple: true # Step 2: Create GitHub release with artifacts - - name: Create/Update GitHub release + - name: Create GitHub release uses: ncipollo/release-action@v1 with: - artifacts: "goose-*.zip" + artifacts: "goose-*.tar.bz2" token: ${{ secrets.GITHUB_TOKEN }} - allowUpdates: true - omitBody: true - omitPrereleaseDuringUpdate: true - - pr-comment: - name: Add PR Comment - runs-on: ubuntu-latest - needs: [build] - permissions: - pull-requests: write - if: github.event_name == 'pull_request' - steps: - # Step 1: Download all artifacts - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - merge-multiple: true - - # Step 2: Create comment with download links - - name: Find Comment - uses: peter-evans/find-comment@v2 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: Build artifacts for this PR - - - name: Create or update comment - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - ### CLI Binaries for this PR - - The following binaries are available for testing: - - - [📦 macOS ARM64 (M1/M2)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-aarch64-apple-darwin.zip) - - [📦 macOS x86_64 (Intel)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-apple-darwin.zip) - - [📦 Linux x86_64](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-unknown-linux-gnu.zip) - - Each archive contains the `goose` CLI binary. - - These links are provided by nightly.link and will work even if you're not logged into GitHub. - edit-mode: replace \ No newline at end of file From 8c97a74e8728393e54228d9e9c1744a23cfe1ca6 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Sat, 21 Dec 2024 16:28:50 +1100 Subject: [PATCH 9/9] description only --- .github/workflows/desktop-app-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop-app-release.yaml b/.github/workflows/desktop-app-release.yaml index 72bd69d83fad..29f7664e72f8 100644 --- a/.github/workflows/desktop-app-release.yaml +++ b/.github/workflows/desktop-app-release.yaml @@ -149,7 +149,7 @@ jobs: The following build is available for testing: - - [📱 macOS ARM64 Desktop App (Universal, signed)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/Goose-darwin-arm64.zip) + - [📱 macOS Desktop App (Universal, signed)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/Goose-darwin-arm64.zip) The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder.