-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile, upload and release library (#222)
- Loading branch information
1 parent
f4dab48
commit 2297dd8
Showing
1 changed file
with
50 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build | ||
|
||
env: | ||
Branch: ${{github.ref_name}} | ||
Solution: windows/libmysofa.sln | ||
Configuration: Release | ||
Artifacts: windows/bin/x64/Release | ||
|
||
on: | ||
push: | ||
Branches: $Branch | ||
pull_request: | ||
Branches: $Branch | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Windows: | ||
runs-on: windows-latest | ||
steps: | ||
|
||
- name: Clone repo and submodules | ||
run: git clone --recurse-submodules https://github.com/${{github.repository}}.git . --branch ${{env.Branch}} | ||
|
||
- name: Get current date, commit hash and count | ||
run: | | ||
echo "CommitDate=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" >> $env:GITHUB_ENV | ||
echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV | ||
echo "CommitCount=$(git rev-list --count HEAD)" >> $env:GITHUB_ENV | ||
- name: Add MSBuild to PATH | ||
uses: microsoft/[email protected] | ||
|
||
- name: Build | ||
run: | | ||
msbuild /m ${{env.Solution}} #/p:Configuration="${{env.Configuration}}" | ||
- name: Upload Installer Artifact to GitHub | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}" | ||
path: "${{github.workspace}}/${{env.Artifacts}}/" | ||
|
||
- name: GitHub pre-release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{secrets.GITHUB_TOKEN}}" | ||
automatic_release_tag: "latest" | ||
prerelease: true | ||
title: "[${{env.CommitDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}" | ||
files: "${{env.Artifacts}}/*" |