Skip to content

Build & Release

Build & Release #18

Workflow file for this run

name: Build & Release
on:
release:
types: [ published ]
jobs:
build:
name: Build
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
dotnet-quality: ga
- name: Install OpenVR Dependencies
shell: cmd
run: |
call cd EasyOpenVR
call download_openvr_api_dependencies.cmd
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build OpenVR2WS/OpenVR2WS.csproj --configuration Release --runtime win-x64
- name: Publish
run: dotnet publish OpenVR2WS/OpenVR2WS.csproj --no-build --configuration Release -o release
- name: Zip release build
shell: bash
run: |
7z a -tzip "OpenVR2WS_${{github.event.release.tag_name}}.zip" "./release/*"
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: release
path: OpenVR2WS_${{github.event.release.tag_name}}.zip
- name: Restore local tools
run: dotnet tool restore
- name: Generate TypeScript
run: dotnet dotnet-typegen generate -p OpenVR2WS
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Types
path: Types
release:
name: Upload Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: release
- name: Display structure of downloaded files
run: ls -R .
- name: Upload file to release
uses: softprops/action-gh-release@v2
with:
files: |
**/*.zip
publishNPM:
name: Publish NPM Package
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Types
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}