-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zangmiao
committed
Feb 24, 2024
0 parents
commit 5a09d4a
Showing
6 changed files
with
1,626 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build_release: | ||
strategy: | ||
matrix: | ||
target: | ||
- x86_64-unknown-linux-musl | ||
- x86_64-pc-windows-msvc | ||
- x86_64-apple-darwin | ||
include: | ||
- target: x86_64-unknown-linux-musl | ||
os: ubuntu-latest | ||
- target: x86_64-pc-windows-msvc | ||
os: windows-latest | ||
- target: x86_64-apple-darwin | ||
os: macos-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Install Cross | ||
if: matrix.os == 'ubuntu-latest' | ||
run: cargo install cross | ||
|
||
- name: Build - windows | ||
if: matrix.os == 'windows-latest' | ||
run: cargo build --release --target ${{ matrix.target }} | ||
|
||
- name: Build - linux | ||
if: matrix.os == 'ubuntu-latest' | ||
run: cross build --release --target ${{ matrix.target }} | ||
|
||
- name: Build - macos | ||
if: matrix.os == 'macos-latest' | ||
run: cargo build --release --target ${{ matrix.target }} | ||
|
||
- name: Strip binary (linux and macos) | ||
if: matrix.build == 'linux' || matrix.build == 'macos' | ||
run: strip "target/${{ matrix.target }}/release/iptv-checker-rs" | ||
|
||
- name: Build archive | ||
shell: bash | ||
run: | | ||
# Replace with the name of your binary | ||
binary_name="ffmpeg-tool-rs" | ||
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}" | ||
mkdir "$dirname" | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
mv "target/${{ matrix.target }}/release/$binary_name.exe" "$dirname" | ||
else | ||
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname" | ||
fi | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
7z a "$dirname.zip" "$dirname" | ||
echo "ASSET=$dirname.zip" >> $GITHUB_ENV | ||
else | ||
tar -czf "$dirname.tar.gz" "$dirname" | ||
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV | ||
fi | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
${{ env.ASSET }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/target | ||
*.MOV | ||
.idea | ||
.vscode |
Oops, something went wrong.