Skip to content

Commit

Permalink
Simplify Windows deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 authored and shssoichiro committed Nov 15, 2019
1 parent 3b88415 commit 9d06a5f
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/deploy-windows.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
name: Deploy av_metrics_tool for Windows
name: deploy-windows

on:
release:
types: [created]
push:
tags:
- 'v*.*.*'

jobs:
upload:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Install mingw-w64 and rust specific target
- name: Install mingw-w64
run: |
sudo apt-get install mingw-w64
rustup target add x86_64-pc-windows-gnu
- name: Install x86_64-pc-windows-gnu
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-pc-windows-gnu
- name: Set rust for cross-compilation
env:
TARGET: rustlib/x86_64-pc-windows-gnu/lib/
Expand All @@ -29,11 +35,19 @@ jobs:
env:
TOOL_PATH: target/x86_64-pc-windows-gnu/release/av-metrics-tool.exe
run: |
cargo build --release --target x86_64-pc-windows-gnu
mv $TOOL_PATH $GITHUB_WORKSPACE
- name: Upload binary
uses: skx/github-action-publish-binaries@master
cargo build --release --target x86_64-pc-windows-gnu
mv $TOOL_PATH $GITHUB_WORKSPACE
- name: Get version and changelog
id: data
run: |
VERSION=$(head -n 1 CHANGELOG.md | tr -d "## Version ")
echo "::set-output name=version::$VERSION"
tail -n +2 CHANGELOG.md | sed -e '/^$/,$d' > CHANGELOG.txt
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: Version ${{ steps.data.outputs.version }}
body_path: CHANGELOG.txt
files: av-metrics-tool.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'av-metrics-tool.exe'

0 comments on commit 9d06a5f

Please sign in to comment.