diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a70beae..3461774 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/create-release@v1.1.0 + 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: @@ -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