Skip to content

Commit

Permalink
Merge pull request #194 from leyou240/master
Browse files Browse the repository at this point in the history
support linux x64 gnu build
  • Loading branch information
heqingpan authored Jan 12, 2025
2 parents 97859ca + 6bc25af commit b7bf484
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
matrix:
target:
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
Expand All @@ -25,6 +26,9 @@ jobs:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: rnacos-x86_64-unknown-linux-musl-${GITHUB_REF#refs/*/}.tar.gz
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: rnacos-x86_64-unknown-linux-gnu-${GITHUB_REF#refs/*/}.tar.gz
- target: x86_64-apple-darwin
os: macos-13
name: rnacos-x86_64-apple-darwin-${GITHUB_REF#refs/*/}.tar.gz
Expand All @@ -49,7 +53,7 @@ jobs:
targets: ${{ matrix.target }}

- name: Install musl tools
if: matrix.os == 'ubuntu-latest'
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get install -y musl-tools

# Install gnu-tar because BSD tar is buggy
Expand All @@ -68,7 +72,10 @@ jobs:
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
cargo build --release --target ${{ matrix.target }}
- name: Build linux-gnu
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
cargo build --release --target ${{ matrix.target }}
- name: Archive binary (windows)
if: matrix.os == 'windows-latest'
run: |
Expand All @@ -93,7 +100,16 @@ jobs:
cd -
echo ${{ matrix.name }}
echo ${GITHUB_REF#refs/*/}
- name: Archive binary (linux-gnu)
if: matrix.target =='x86_64-unknown-linux-gnu'
run: |
# 注意,下面进入了三级目录,与上面两个打包操作路径不同
cd target/x86_64-unknown-linux-gnu/release
cp ../../../doc/conf/.env.example .env
tar czvf ../../../${{ matrix.name }} rnacos .env
cd -
echo ${{ matrix.name }}
echo ${GITHUB_REF#refs/*/}
- name: Upload binary artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
matrix:
target:
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
Expand All @@ -29,6 +30,9 @@ jobs:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: rnacos-x86_64-unknown-linux-musl-${GITHUB_REF#refs/*/}.tar.gz
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: rnacos-x86_64-unknown-linux-gnu-${GITHUB_REF#refs/*/}.tar.gz
- target: x86_64-apple-darwin
os: macos-13
name: rnacos-x86_64-apple-darwin-${GITHUB_REF#refs/*/}.tar.gz
Expand All @@ -53,8 +57,8 @@ jobs:
targets: ${{ matrix.target }}

- name: Install musl tools
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y musl-tools
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get install -y musl-tools

# Install gnu-tar because BSD tar is buggy
# https://github.com/actions/cache/issues/403
Expand All @@ -73,6 +77,11 @@ jobs:
run: |
cargo build --release --target ${{ matrix.target }}
- name: Build linux-gnu
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
cargo build --release --target ${{ matrix.target }}
- name: Archive binary (windows)
if: matrix.os == 'windows-latest'
run: |
Expand All @@ -95,7 +104,14 @@ jobs:
cp ../../../doc/conf/.env.example .env
tar czvf ../../../${{ matrix.name }} rnacos .env
cd -
- name: Archive binary (linux-gnu)
if: matrix.target =='x86_64-unknown-linux-gnu'
run: |
# 注意,下面进入了三级目录,与上面两个打包操作路径不同
cd target/x86_64-unknown-linux-gnu/release
cp ../../../doc/conf/.env.example .env
tar czvf ../../../${{ matrix.name }} rnacos .env
cd -
- name: Upload binary artifacts
uses: actions/upload-artifact@v3
with:
Expand Down

0 comments on commit b7bf484

Please sign in to comment.