summaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2024-06-28 14:53:43 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2024-06-28 14:53:43 +0100
commitef34f0bb4798a0d1410fffc974f084e4c6cfb920 (patch)
tree927965d3de187e2af5d594e6018b635a416ef6fb /.github/workflows
downloadviewercount-ef34f0bb4798a0d1410fffc974f084e4c6cfb920.tar.gz
viewercount-ef34f0bb4798a0d1410fffc974f084e4c6cfb920.tar.bz2
viewercount-ef34f0bb4798a0d1410fffc974f084e4c6cfb920.zip
Initial commit
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yml22
-rw-r--r--.github/workflows/deps.yml15
-rw-r--r--.github/workflows/release.yml62
3 files changed, 99 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..67f18c3
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,22 @@
+name: CI
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+
+env:
+ CARGO_TERM_COLOR: always
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Build
+ run: cargo build --verbose
+ - name: Run tests
+ run: cargo test --verbose
diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml
new file mode 100644
index 0000000..344131f
--- /dev/null
+++ b/.github/workflows/deps.yml
@@ -0,0 +1,15 @@
+name: Bump deps
+
+on:
+ workflow_dispatch:
+jobs:
+ latest_deps:
+ name: Latest Dependencies
+ runs-on: ubuntu-latest
+ continue-on-error: true
+ steps:
+ - uses: actions/checkout@v3
+ - run: rustup update stable && rustup default stable
+ - run: cargo update --verbose
+ - run: cargo build --verbose
+ - run: cargo test --verbose
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..720b337
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,62 @@
+name: Release
+on:
+ push:
+ tags:
+ - v*
+ branches:
+ - v*
+jobs:
+ release:
+ strategy:
+ matrix:
+ platform:
+ - os: ubuntu-latest
+ target: x86_64-unknown-linux-gnu
+ bin: viewercount
+ name: viewercount-${{ github.ref_name }}-linux-x86_64
+ - os: ubuntu-latest
+ target: aarch64-unknown-linux-gnu
+ bin: viewercount
+ name: viewercount-${{ github.ref_name }}-linux-aarch64
+ - os: windows-latest
+ target: x86_64-pc-windows-msvc
+ bin: viewercount.exe
+ name: viewercount-${{ github.ref_name }}-windows-x86_64
+ - os: macos-latest
+ target: x86_64-apple-darwin
+ bin: viewercount
+ name: viewercount-${{ github.ref_name }}-darwin-x86_64
+ runs-on: ${{ matrix.platform.os }}
+ steps:
+ - uses: actions/checkout@v4
+ - uses: Swatinem/rust-cache@v2
+ - name: Build binary
+ uses: houseabsolute/actions-rust-cross@v0
+ with:
+ target: ${{ matrix.platform.target }}
+ args: "--locked --release"
+ strip: true
+ - name: Package
+ shell: bash
+ run: |
+ mkdir ${{ matrix.platform.name }}
+ cp target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} ${{ matrix.platform.name }}
+ cp LICENSE.txt ${{ matrix.platform.name }}
+ cp README.md ${{ matrix.platform.name }}
+ if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]
+ then
+ 7z a ${{ matrix.platform.name }}.zip ${{ matrix.platform.name }}
+ else
+ tar czvf ${{ matrix.platform.name }}.tar.gz ${{ matrix.platform.name }}
+ fi
+ - name: Generate Changelog
+ run: utils/generate_changelog.sh > ${{ github.workspace }}-CHANGELOG.md
+ - name: Publish
+ uses: softprops/action-gh-release@v2
+ if: startsWith(github.ref, 'refs/tags/')
+ with:
+ body_path: ${{ github.workspace }}-CHANGELOG.md
+ fail_on_unmatched_files: true
+ files: viewercount-*
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}