Skip to content

Commit

Permalink
Split release to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Dec 30, 2023
1 parent 5fe33a9 commit 650b60e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 48 deletions.
51 changes: 3 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,51 +93,6 @@ jobs:
needs: build
uses: ./.github/workflows/sdplugin.yml
release:
needs: [streamDeckPlugin]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: ${{runner.temp}}/artifacts
- name: Display downloaded files
run: ls -R
working-directory: ${{runner.temp}}/artifacts
- name: Check if this is a release push
id: ref
run: |
if echo ${{github.ref}} | grep --silent refs/tags/v; then
echo "::set-output name=is-release::true"
echo "::set-output name=tag::$(echo ${{github.ref}} | awk -F/ '{print $NF}')"
else
echo "::set-output name=is-release::false"
fi
- name: Create Draft Release
id: create-release
if: steps.ref.outputs.is-release == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: Release ${{ steps.ref.outputs.tag }}
tag_name: ${{steps.ref.outputs.tag}}
draft: true
- name: Attach Release Build
if: steps.ref.outputs.is-release == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{runner.temp}}/artifacts/RelWithDebInfo-StreamDeckPlugin/com.fredemmott.micmutetoggle.streamDeckPlugin
asset_name: com.fredemmott.micmutetoggle.streamDeckPlugin
asset_content_type: application/octet-stream
- name: Attach PDB Files
if: steps.ref.outputs.is-release == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{runner.temp}}/artifacts/DebugSymbols-windows-RelWithDebInfo/sdmicmute.pdb
asset_name: sdmicmute.pdb
asset_content_type: application/octet-stream
needs: streamDeckPlugin
uses: ./.github/workflows/release.yml
secrets: inherit
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Prepare release
on:
workflow_call:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: ${{runner.temp}}/artifacts
- name: Display downloaded files
run: ls -R
working-directory: ${{runner.temp}}/artifacts
- name: Check if this is a release push
id: ref
run: |
if echo ${{github.ref}} | grep --silent refs/tags/v; then
echo "::set-output name=is-release::true"
echo "::set-output name=tag::$(echo ${{github.ref}} | awk -F/ '{print $NF}')"
else
echo "::set-output name=is-release::false"
fi
- name: Create Draft Release
id: create-release
if: steps.ref.outputs.is-release == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: Release ${{ steps.ref.outputs.tag }}
tag_name: ${{steps.ref.outputs.tag}}
draft: true
- name: Attach Release Build
if: steps.ref.outputs.is-release == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{runner.temp}}/artifacts/RelWithDebInfo-StreamDeckPlugin/com.fredemmott.micmutetoggle.streamDeckPlugin
asset_name: com.fredemmott.micmutetoggle.streamDeckPlugin
asset_content_type: application/octet-stream
- name: Attach PDB Files
if: steps.ref.outputs.is-release == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{runner.temp}}/artifacts/DebugSymbols-windows-RelWithDebInfo/sdmicmute.pdb
asset_name: sdmicmute.pdb
asset_content_type: application/octet-stream

0 comments on commit 650b60e

Please sign in to comment.