Skip to content

Commit

Permalink
rcon cli v1
Browse files Browse the repository at this point in the history
  • Loading branch information
gdgunnars committed Apr 29, 2024
0 parents commit 7f3e3aa
Show file tree
Hide file tree
Showing 15 changed files with 1,684 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/on-release.yaml
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
50 changes: 50 additions & 0 deletions .vscode/launch.json
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}"
}
]
}
Loading

0 comments on commit 7f3e3aa

Please sign in to comment.