Skip to content

Commit

Permalink
Merge pull request #51 from hunjixin/feat/add_build_artifact
Browse files Browse the repository at this point in the history
feat: 发布的时候自动上传生成结果/add build artifact when release
  • Loading branch information
diwufeiwen committed Jul 22, 2022
2 parents 70c39f8 + 4a51c7f commit f37ebd3
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: dependencies
run: sudo apt update && sudo apt install -y

- name: Set up Go
uses: actions/setup-go@v2
with:
Expand All @@ -39,7 +42,7 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
./target/
key: ${{ runner.os }}-cargo-${{ hashFiles('tools/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: install deps
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/rust_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: dependencies
run: sudo apt update && sudo apt install -y

- name: setup rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -34,7 +37,7 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
venus-worker/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('tools/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: lint
run: |
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build for test/release

on:
push:
branches: [master]
tags: ['**']
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
fetch-depth: '0'

- name: dependencies
run: sudo apt update && sudo apt install -y

- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: wasm32-unknown-unknown
override: true
components: rustfmt, clippy

- name: setup build cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: Build
run: |
make build
cp target/release/go-fvm-sdk-tools target/release/go-fvm-sdk-tools_${{github.ref_name}}_linux-amd64
- name: shasum
run: shasum -a 256 target/release/go-fvm-sdk-tools > target/release/go-fvm-sdk-tools_${{github.ref_name}}_linux-amd64.sha256
shell: bash

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/go-fvm-sdk-tools_${{github.ref_name}}_linux-amd64.sha256
target/release/go-fvm-sdk-tools_${{github.ref_name}}_linux-amd64

0 comments on commit f37ebd3

Please sign in to comment.