publish #6
Workflow file for this run
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
name: publish | |
env: | |
ProjectName: genshin-fps-unlock | |
on: | |
create: | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
name: Build and Release | |
if: ${{ StartsWith(github.ref, 'refs/tags/') }} | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
submodules: 'recursive' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
- name: Publish | |
if: ${{ success() }} | |
shell: pwsh | |
run: | | |
echo ${{ github.ref }} | |
dotnet publish unlockfps_gui --runtime win-x64 --configuration Release --output ci-publish-win64 | |
rm ./ci-publish-win64/*.pdb | |
- name: Get tag | |
uses: dawidd6/action-get-tag@v1 | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
id: tag | |
- name: Pack via 7z | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
mkdir -p ./ci-pack/ | |
7z a -mx9 -mfb=273 -ms -md=31 -myx=9 -mtm=- -mmt -mmtf -md=1536m -mmf=bt3 -mmc=10000 -mpb=0 -mlc=0 "./ci-pack/${{ env.ProjectName }}-${{ steps.tag.outputs.tag }}-win64.7z" "./ci-publish-win64/*" -x!"${{ env.ProjectName }}" -r | |
- name: Create a new GitHub release if a new tag is pushed | |
uses: softprops/action-gh-release@v1 | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
name: ${{ steps.tag.outputs.tag }} | |
prerelease: true | |
draft: false | |
files: | | |
./ci-pack/${{ env.ProjectName }}-${{ steps.tag.outputs.tag }}-win64.7z |