Skip to content

ci: update ci

ci: update ci #31

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: [v*]
pull_request:
branches: [main]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/cache@v4
with:
path: ~/.cargo/git
key: cargo-index-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/cache@v4
with:
path: target
key: cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- shell: bash
run: rustup target add i686-pc-windows-msvc
- shell: bash
run: cargo build --target i686-pc-windows-msvc --release
- shell: bash
run: |
mkdir artifact
mv ./target/i686-pc-windows-msvc/release/dinput8.dll \
./artifact/dinput8.dll
- uses: actions/upload-artifact@v4
with:
name: artifact
path: ./artifact
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
env:
FILENAME: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip
steps:
- uses: actions/download-artifact@v4
name: artifact
- run: |
zip --junk-paths ${{ env.FILENAME }} ./artifact/*
- name: Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
files: |
${{ env.FILENAME }}