Skip to content

feat: mg34

feat: mg34 #47

Workflow file for this run

name: release
on:
push:
tags:
- v*
jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
# TODO : true if tag contain "rc"
prerelease: false
build-msys-mingw64:
name: Build and package for Windows
needs: create-release
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Setup msys2 dependencies
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git zip mingw-w64-x86_64-cc mingw-w64-x86_64-rust mingw-w64-x86_64-zeromq mingw-w64-x86_64-pkg-config
- name: Run cargo check
run: cargo check --release
- name: Build
run: cargo build --bin battle_gui --bin battle_server --bin oc_launcher --release
- name: Package
run: tools/package_release_windows.sh ${{ github.ref_name }}
- name: Upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
UPLOAD_URL: ${{ needs.create-release.outputs.upload_url }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: OpenCombat_${{ github.ref_name }}_Win64.zip
asset_name: OpenCombat_${{ github.ref_name }}_Win64.zip
asset_content_type: application/zip
build-linux:
name: Build and package for Linux
needs: create-release
runs-on: ubuntu-20.04
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install OS dependencies
run: sudo apt-get install -y zip build-essential cmake pkg-config libasound2-dev libfontconfig-dev libudev-dev libzmq3-dev
- name: Run cargo check
run: cargo check --release
- name: Build
run: cargo build --bin battle_gui --bin battle_server --bin oc_launcher --release
- name: Package
run: tools/package_release_linux.sh ${{ github.ref_name }}
- name: Upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
UPLOAD_URL: ${{ needs.create-release.outputs.upload_url }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: OpenCombat_${{ github.ref_name }}_Linux.zip
asset_name: OpenCombat_${{ github.ref_name }}_Linux.zip
asset_content_type: application/zip