Skip to content

Commit

Permalink
[release] Split release workflow to release and release_asset.
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar committed Jul 21, 2020
1 parent bc864f2 commit 2fab4e5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 41 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,3 @@ jobs:
draft: false
prerelease: false
body_path: docs/release-notes/${{ steps.get_version.outputs.VERSION }}.md

build:
name: Build release asset
strategy:
matrix:
platform:
- ubuntu-latest
- macos-latest
- windows-latest
toolchain:
- stable
runs-on: ${{matrix.platform}}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- name: setup llvm
if: matrix.platform == 'windows-latest'
run: .\scripts\install_llvm.ps1
shell: powershell
- name: build for ${{ matrix.platform }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all
- name: build release asset
run: bash ./scripts/release.sh ${{ matrix.platform }}
- name: upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ jobs.release.steps.create_release.outputs.upload_url }}
asset_path: ./starcoin-${{ matrix.platform }}.zip
asset_name: starcoin-${{ matrix.platform }}.zip
asset_content_type: application/zip
44 changes: 44 additions & 0 deletions .github/workflows/release_asset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
release:
types: [published]
jobs:
build:
name: Build release asset
strategy:
matrix:
platform:
- ubuntu-latest
- macos-latest
- windows-latest
toolchain:
- stable
runs-on: ${{matrix.platform}}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- name: setup llvm
if: matrix.platform == 'windows-latest'
run: .\scripts\install_llvm.ps1
shell: powershell
- name: build for ${{ matrix.platform }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all
- name: build release asset
run: bash ./scripts/release.sh ${{ matrix.platform }}
- name: upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./starcoin-${{ matrix.platform }}.zip
asset_name: starcoin-${{ matrix.platform }}.zip
asset_content_type: application/zip

0 comments on commit 2fab4e5

Please sign in to comment.