Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
honhimW authored Sep 13, 2024
1 parent 96e98c9 commit 95cf48a
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ on:
workflow_dispatch:

jobs:
create_release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Create Release
if: github.event_name == 'workflow_dispatch'
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
build:
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -16,28 +34,26 @@ jobs:
uses: actions/checkout@v4
- name: Build
run: cargo build --release --verbose
- name: Create Release
if: github.event_name == 'workflow_dispatch'
id: create_release
uses: actions/create-release@v1
- name: Upload Release Asset (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: true
- name: Upload Release Asset (Linux/Mac)
if: matrix.os != 'windows-latest'
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/ratisui
asset_name: ratisui-linux
asset_content_type: application/octet-stream
- name: Upload Release Asset (Mac)
if: matrix.os == 'macos-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/ratisui
asset_name: ratisui
asset_name: ratisui-mac
asset_content_type: application/octet-stream

- name: Upload Release Asset (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-release-asset@v1
Expand Down

0 comments on commit 95cf48a

Please sign in to comment.