Skip to content

Commit

Permalink
fixup! Fixes release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
drake127 committed Sep 11, 2024
1 parent 3bc8867 commit bd534f2
Showing 1 changed file with 47 additions and 21 deletions.
68 changes: 47 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,35 @@ jobs:
name: Create release
needs: build_artifacts
runs-on: ubuntu-latest
outputs:
upload_url: ${{steps.create_release.outputs.upload_url}}

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

- name: Create a release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{github.ref}}
release_name: ${{github.ref}}
draft: true
prerelease: false
commitish: master

publish_windows_asset:
name: Publish Windows asset
needs: create_release
runs-on: ubuntu-latest

steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v4
with:
name: windows-artifact

- name: Create a mod package
run: |
Expand All @@ -30,36 +52,40 @@ jobs:
cp windows-artifact/cpuid-rdrand.pdb randomrolls/tools/
cp README.md randomrolls/readme.txt
7z a randomrolls-win.zip randomrolls Setup-randomrolls.exe
7z a randomrolls-linux.zip ./linux-artifact/rand.so
- name: Create a release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
commitish: master

- name: Publish Linux artifacts
- name: Publish asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: randomrolls-linux.zip
asset_name: randomrolls-linux.zip
upload_url: ${{needs.create_release.outputs.upload_url}}
asset_path: randomrolls-win.zip
asset_name: randomrolls-win.zip
asset_content_type: application/zip

- name: Publish Windows artifacts
publish_linux_asset:
name: Publish Linux asset
needs: create_release
runs-on: ubuntu-latest

steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v4
with:
name: linux-artifact

- name: Create a mod package
run: |
cp linux-artifact/rand.so randomrolls/
cp README.md randomrolls/readme.txt
7z a randomrolls-linux.zip randomrolls/rand.so randomrolls/readme.txt
- name: Publish asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: randomrolls-win.zip
asset_name: randomrolls-win.zip
upload_url: ${{needs.create_release.outputs.upload_url}}
asset_path: randomrolls-linux.zip
asset_name: randomrolls-linux.zip
asset_content_type: application/zip

0 comments on commit bd534f2

Please sign in to comment.