Skip to content

Commit

Permalink
chore: improve publish workflow to only build on release
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek-12 committed Dec 8, 2024
1 parent bb80453 commit 12f412e
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 9 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/desktop-linux.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
name: debugger-linux

on:
push:
branches: [ master ]
workflow_call:
outputs:
debugger:
value: ${{ jobs.publish.outputs.debugger-url }}
sample:
value: ${{ jobs.publish.outputs.sample-url }}

concurrency:
group: "publish-linux"
cancel-in-progress: true

jobs:
publish-windows:
publish:
runs-on: ubuntu-latest
environment: publishing
outputs:
debugger-url: ${{ steps.upload-debugger.outputs.artifact-url }}
sample-url: ${{ steps.upload-sample.outputs.artifact-url }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -49,17 +56,21 @@ jobs:
run: ./gradlew sample:packageDistributionForCurrentOS

- name: Upload debugger
id: upload-debugger
uses: actions/[email protected]
with:
name: Debugger_Linux
path: ./debugger/app/build/compose/binaries/main/deb/*
if-no-files-found: error
compression-level: 0
overwrite: false

- name: Upload sample
id: upload-sample
uses: actions/[email protected]
with:
name: Sample_Linux
path: ./sample/build/compose/binaries/main/deb/*
if-no-files-found: error
compression-level: 0
overwrite: false
17 changes: 14 additions & 3 deletions .github/workflows/desktop-macos.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
name: debugger-macos

on:
push:
branches: [ master ]
workflow_call:
outputs:
debugger:
value: ${{ jobs.publish.outputs.debugger-url }}
sample:
value: ${{ jobs.publish.outputs.sample-url }}

concurrency:
group: "publish-macos"
cancel-in-progress: true

jobs:
publish-windows:
publish:
runs-on: macos-latest
environment: publishing
outputs:
debugger-url: ${{ steps.upload-debugger.outputs.artifact-url }}
sample-url: ${{ steps.upload-sample.outputs.artifact-url }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -49,17 +56,21 @@ jobs:
run: ./gradlew sample:packageDistributionForCurrentOS

- name: Upload debugger
id: upload-debugger
uses: actions/[email protected]
with:
name: Debugger_MacOS
path: ./debugger/app/build/compose/binaries/main/dmg/*
if-no-files-found: error
compression-level: 0
overwrite: false

- name: Upload sample
id: upload-sample
uses: actions/[email protected]
with:
name: Sample_MacOS
path: ./sample/build/compose/binaries/main/dmg/*
if-no-files-found: error
compression-level: 0
overwrite: false
17 changes: 14 additions & 3 deletions .github/workflows/desktop-win.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
name: debugger-windows

on:
push:
branches: [ master ]
workflow_call:
outputs:
debugger:
value: ${{ jobs.publish.outputs.debugger-url }}
sample:
value: ${{ jobs.publish.outputs.sample-url }}

concurrency:
group: "publish-win"
cancel-in-progress: true

jobs:
publish-windows:
publish:
runs-on: windows-latest
environment: publishing
outputs:
debugger-url: ${{ steps.upload-debugger.outputs.artifact-url }}
sample-url: ${{ steps.upload-sample.outputs.artifact-url }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -50,17 +57,21 @@ jobs:
run: ./gradlew sample:packageDistributionForCurrentOS

- name: Upload debugger
id: upload-debugger
uses: actions/[email protected]
with:
name: Debugger_Windows
path: ./debugger/app/build/compose/binaries/main/exe/*
if-no-files-found: error
compression-level: 0
overwrite: false

- name: Upload sample
id: upload-sample
uses: actions/[email protected]
with:
name: Sample_Windows
path: ./sample/build/compose/binaries/main/exe/*
if-no-files-found: error
compression-level: 0
overwrite: false
13 changes: 13 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ concurrency:
cancel-in-progress: true

jobs:
debugger-macos:
uses: ./.github/workflows/desktop-macos.yml
debugger-linux:
uses: ./.github/workflows/desktop-linux.yml
debugger-win:
uses: ./.github/workflows/desktop-win.yml

publish:
runs-on: macos-latest

Expand Down Expand Up @@ -72,6 +79,12 @@ jobs:
commitMode: true
configuration: ".github/changelog_config.json"

- name: Publish new plugin version
run: ./gradlew debugger:ideplugin:publishPlugin --no-configuration-cache
env:
CHANGELOG: ${{steps.build_changelog.outputs.changelog}}

# TODO: Use matrix strat and attach artifacts to the release
- name: Create GH release
uses: ncipollo/[email protected]
id: create_release
Expand Down

0 comments on commit 12f412e

Please sign in to comment.