Skip to content

Commit

Permalink
Fix release version in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Jul 13, 2024
1 parent 8a3c0dd commit aad5a3f
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:

# Create release when pushing a tag.
release:
name: Create Release
runs-on: ubuntu-latest
Expand All @@ -23,11 +24,10 @@ jobs:
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
# Create release when pushing a tag.
if: startsWith(github.ref, 'refs/tags/')
with:
name: Release ${{ github.ref }}
tag_name: ${{ github.ref }}
name: Release ${{ steps.get_version.outputs.VERSION }}
tag_name: ${{ steps.get_version.outputs.VERSION }}
# TODO: proper release content, now it's manually updated.
body: Release ${{ steps.get_version.outputs.VERSION }}
draft: true
Expand Down Expand Up @@ -91,36 +91,37 @@ jobs:
version: "15.0"
if: ${{ matrix.build.os == 'macos-latest' || matrix.build.os == 'macos-14' }}

- name: Install target
run: |
rustup target add ${{ matrix.build.target }}
- name: Install cross
run: |
cargo install cross --git https://github.com/cross-rs/cross
if: ${{ matrix.build.command == 'cross' }}

- name: Configure cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.build.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build binary
run: |
${{ matrix.build.command }} build --profile production --bin subcoin --locked --target ${{ matrix.build.target }}
# - name: Install target
# run: |
# rustup target add ${{ matrix.build.target }}

# - name: Install cross
# run: |
# cargo install cross --git https://github.com/cross-rs/cross
# if: ${{ matrix.build.command == 'cross' }}

# - name: Configure cache
# uses: actions/cache@v4
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/
# key: ${{ runner.os }}-${{ matrix.build.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}

# - name: Build binary
# run: |
# ${{ matrix.build.command }} build --profile production --bin subcoin --locked --target ${{ matrix.build.target }}

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.build.target }}/production/${{ matrix.build.artifact_name }}
asset_name: subcoin-${{ github.ref }}-${{ matrix.build.os_prefix }}-${{ matrix.build.target }}
# file: target/${{ matrix.build.target }}/production/${{ matrix.build.artifact_name }}
file: README.md
tag: ${{ github.ref }}
asset_name: subcoin-${{ github.ref }}-${{ matrix.build.os_prefix }}-${{ matrix.build.target }}
overwrite: true

0 comments on commit aad5a3f

Please sign in to comment.