Merge branch 'master' of https://github.com/dawn-lc/Pings #72
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: Release | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '*.cs' | |
- '*.csproj' | |
- '*.sln' | |
jobs: | |
Release: | |
if: github.actor != 'github-actions' | |
runs-on: windows-latest | |
env: | |
Project_Name: Pings | |
Solution_Name: Pings.sln | |
Release_Tag: latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v3.0.0 | |
with: | |
versionSpec: '6.x' | |
- name: Determine Version | |
uses: gittools/actions/gitversion/execute@v3.0.0 | |
with: | |
useConfigFile: true | |
- name: Publish Windows Binaries | |
run: dotnet publish ./${{ env.Project_Name }}.csproj -r win-x64 -c Release --output ./ | |
- name: Compress binaries | |
uses: crazy-max/ghaction-upx@v3 | |
with: | |
version: latest | |
args: --ultra-brute -k -o upx-${{ env.Project_Name }}.exe | |
files: | | |
./${{ env.Project_Name }}.exe | |
- name: Create Git tag And Push | |
run: | | |
git config --global user.name github-actions | |
git config --global user.email github-actions@github.com | |
git tag -a v${{ env.GitVersion_SemVer }} -m "Github Actions release ${{ env.GitVersion_SemVer }}" | |
git push origin v${{ env.GitVersion_SemVer }} | |
- name: 发布新版本 | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ env.Release_Tag }}" | |
prerelease: false | |
title: "${{ env.GitVersion_SemVer }}" | |
files: | | |
./${{ env.Project_Name }}.exe | |
./upx-${{ env.Project_Name }}.exe | |