-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
1 changed file
with
61 additions
and
123 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 |
---|---|---|
|
@@ -9,136 +9,74 @@ env: | |
BIN: migo-hqm-server | ||
|
||
jobs: | ||
windows: | ||
runs-on: windows-latest | ||
build: | ||
runs-on: ${{ matrix.platform.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- x86_64-pc-windows-msvc | ||
- aarch64-pc-windows-msvc | ||
platform: | ||
- target: x86_64-pc-windows-msvc | ||
os: windows-latest | ||
- target: aarch64-pc-windows-msvc | ||
os: windows-latest | ||
- target: x86_64-apple-darwin | ||
os: macos-latest | ||
- target: aarch64-apple-darwin | ||
os: macos-latest | ||
- target: aarch64-unknown-linux-gnu | ||
os: ubuntu-latest | ||
- target: aarch64-unknown-linux-musl | ||
os: ubuntu-latest | ||
- target: armv7-unknown-linux-gnueabihf | ||
os: ubuntu-latest | ||
- target: armv7-unknown-linux-musleabihf | ||
os: ubuntu-latest | ||
- target: arm-unknown-linux-gnueabihf | ||
os: ubuntu-latest | ||
- target: arm-unknown-linux-musleabihf | ||
os: ubuntu-latest | ||
- target: i686-unknown-linux-gnu | ||
os: ubuntu-latest | ||
- target: i686-unknown-linux-musl | ||
os: ubuntu-latest | ||
- target: i686-unknown-freebsd | ||
os: ubuntu-latest | ||
- target: x86_64-unknown-linux-gnu | ||
os: ubuntu-latest | ||
- target: x86_64-unknown-linux-musl | ||
os: ubuntu-latest | ||
- target: x86_64-unknown-freebsd | ||
os: ubuntu-latest | ||
- target: riscv64gc-unknown-linux-gnu | ||
os: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
- uses: actions/checkout@v4 | ||
- name: Cache cargo & target directories | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Install musl-tools on Linux | ||
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools | ||
if: contains(matrix.platform.target, 'musl') | ||
- name: Build binary | ||
uses: houseabsolute/actions-rust-cross@v0 | ||
with: | ||
toolchain: stable | ||
target: ${{matrix.target}} | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --target ${{matrix.target}} | ||
command: "build" | ||
target: ${{ matrix.platform.target }} | ||
toolchain: "stable" | ||
args: "--locked --release" | ||
strip: true | ||
- run: | | ||
7z a "${{ env.BIN }}.zip" config.ini README.md example_replay_integration.py ".\target\${{ matrix.target }}\release\${{ env.BIN }}.exe" | ||
7z a migo-hqm-server.zip config.ini README.md example_replay_integration.py ".\target\${{ matrix.platform.target }}\release\migo-hqm-server.exe" | ||
shell: bash | ||
- uses: XAMPPRocky/[email protected] | ||
id: create_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
# Draft should **always** be false. GitHub doesn't provide a way to | ||
# get draft releases from its API, so there's no point using it. | ||
draft: false | ||
prerelease: false | ||
- uses: actions/upload-release-asset@v1 | ||
id: upload-release-asset | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: matrix.platform.os == 'windows-latest' | ||
- run: | | ||
tar -czvf migo-hqm-server.tar.gz config.ini README.md example_replay_integration.py -C target/${{ matrix.platform.target }}/release migo-hqm-server | ||
shell: bash | ||
if: matrix.platform.os != 'windows-latest' | ||
- run: ls -lhrt | ||
- name: Publish GitHub release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ env.BIN }}.zip | ||
asset_name: ${{ env.BIN }}-${{ matrix.target }}.zip | ||
asset_content_type: application/zip | ||
files: "migo-hqm-server-*" | ||
|
||
|
||
macos: | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- x86_64-apple-darwin | ||
- aarch64-apple-darwin | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: ${{matrix.target}} | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --target ${{matrix.target}} | ||
- run: tar -czvf ${{ env.BIN }}.tar.gz config.ini README.md example_replay_integration.py -C target/${{ matrix.target }}/release ${{ env.BIN }} | ||
- uses: XAMPPRocky/[email protected] | ||
id: create_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- uses: actions/upload-release-asset@v1 | ||
id: upload-release-asset | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ env.BIN }}.tar.gz | ||
asset_name: ${{ env.BIN }}-${{ matrix.target }}.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- aarch64-unknown-linux-gnu | ||
- aarch64-unknown-linux-musl | ||
- armv7-unknown-linux-gnueabihf | ||
- armv7-unknown-linux-musleabihf | ||
- arm-unknown-linux-gnueabihf | ||
- arm-unknown-linux-musleabihf | ||
- i686-unknown-linux-gnu | ||
- i686-unknown-linux-musl | ||
- i686-unknown-freebsd | ||
- x86_64-unknown-linux-gnu | ||
- x86_64-unknown-linux-musl | ||
- x86_64-unknown-freebsd | ||
- riscv64gc-unknown-linux-gnu | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: ${{matrix.target}} | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
use-cross: true | ||
command: build | ||
args: --release --target ${{matrix.target}} | ||
- run: tar -czvf ${{ env.BIN }}.tar.gz config.ini README.md example_replay_integration.py -C target/${{ matrix.target }}/release ${{ env.BIN }} | ||
- uses: XAMPPRocky/[email protected] | ||
id: create_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ env.BIN }}.tar.gz | ||
asset_name: ${{ env.BIN }}-${{ matrix.target }}.tar.gz | ||
asset_content_type: application/gzip |