-
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
0 parents
commit 7f3e3aa
Showing
15 changed files
with
1,684 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,72 @@ | ||
name: Release with artifacts | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-upload: | ||
name: build and upload | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- build: linux | ||
os: ubuntu-latest | ||
target: x86_64-unknown-linux-musl | ||
|
||
- build: macos | ||
os: macos-latest | ||
target: aarch64-apple-darwin | ||
|
||
- build: windows-gnu | ||
os: windows-latest | ||
target: x86_64-pc-windows-gnu | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
# Or @nightly if you want | ||
uses: dtolnay/rust-toolchain@stable | ||
# Arguments to pass in | ||
with: | ||
# Make Rust compile to our target (defined in the matrix) | ||
targets: ${{ matrix.target }} | ||
|
||
- name: Get the release version from the tag | ||
shell: bash | ||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
|
||
# TODO: Build project here | ||
- name: Build project | ||
run: cargo build --release --target ${{ matrix.target }} | ||
|
||
- name: Build archive | ||
shell: bash | ||
run: | | ||
# Replace with the name of your binary | ||
binary_name="rcon" | ||
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: Upload Release Asset | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh release upload ${{ env.VERSION }} ${{env.ASSET}}.zip |
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 @@ | ||
/target |
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,50 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug unit tests in library 'rcon'", | ||
"cargo": { | ||
"args": ["test", "--no-run", "--lib", "--package=rcon"], | ||
"filter": { | ||
"name": "rcon", | ||
"kind": "lib" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug executable 'rcon'", | ||
"cargo": { | ||
"args": ["build", "--bin=rcon", "--package=rcon"], | ||
"filter": { | ||
"name": "rcon", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": ["action", "exec", "status"], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug unit tests in executable 'rcon'", | ||
"cargo": { | ||
"args": ["test", "--no-run", "--bin=rcon", "--package=rcon"], | ||
"filter": { | ||
"name": "rcon", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
} | ||
] | ||
} |
Oops, something went wrong.