Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
[skip ci]修改 release 产物名称
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenway committed Dec 1, 2023
1 parent 98ca516 commit 99836b1
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/utils/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ var generateEvb = require('generate-evb');
// Change the following paths to the actual paths used in your project
var evbCliPath = 'enigmavbconsole.exe';
var projectName = 'SDUNetCheckTool.evb';
var inputExe = '../../SduNetCheckTool.GUI/bin/Debug/SduNetCheckTool.GUI.exe';
var inputExe = '../../SduNetCheckTool.GUI/bin/Release/SduNetCheckTool.GUI.exe';
var outputExe = '../../build/SduNetCheckTool.GUI_boxed.exe';
var path2Pack = '../../SduNetCheckTool.GUI/bin/Debug';
var path2Pack = '../../SduNetCheckTool.GUI/bin/Release';

generateEvb(projectName, inputExe, outputExe, path2Pack);

Expand Down
35 changes: 18 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,37 @@ on:
push:
branches:
- master
workflow_call:

jobs:
build:
strategy:
matrix:
targetplatform: [x64]
Configuration: [Debug]
ChannelName: [Prod_Store]
Configuration: [Release]

runs-on: windows-latest

env:
appPackagesArchive: AppPackages.zip
# appPackagesDirectory: bin\x64\${{ matrix.Configuration }}
# artifacts 命名 [名字]-[commit-hash]
artifactName: SduNetCheckTool-${{ github.sha }}
appPackagesArchive: SduNetCheckTool-${{ github.sha }}.zip
appPackagesExecutable: SduNetCheckTool-${{ github.sha }}.exe

solutionPath: SduNetCheckTool.sln
coreProjectDirectory: SduNetCheckTool.Core
guiProjectDirectory: SduNetCheckTool.GUI
coreProjectPath: SduNetCheckTool.Core\SduNetCheckTool.Core.csproj
guiProjectPath: SduNetCheckTool.GUI\SduNetCheckTool.GUI.csproj
Configuration: Debug
appPackagesDirectory: bin\Debug
Configuration: Release
appPackagesDirectory: bin\Release


steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install .NET Core
uses: actions/setup-dotnet@v3
Expand All @@ -44,7 +49,7 @@ jobs:
uses: microsoft/[email protected]

- name: Restore the Wpf application
run: msbuild ${{ env.solutionPath }} /t:Restore /p:Configuration=${{ matrix.Configuration }} /p:RuntimeIdentifier=win
run: msbuild ${{ env.solutionPath }} /t:Restore /p:Configuration=${{ env.Configuration }} /p:RuntimeIdentifier=win

- name: Build wapproj
run: msbuild ${{ env.solutionPath }} /p:Configuration=${{env.Configuration}} /p:UapAppxPackageBuildMode=StoreUpload /p:AppxBundle=Never /p:GenerateAppInstallerFile=False /p:AppxPackageSigningEnabled=False
Expand All @@ -54,23 +59,19 @@ jobs:
mkdir build
Compress-Archive -Path ${{ env.guiProjectDirectory }}\${{ env.appPackagesDirectory }}\* -DestinationPath build\${{ env.appPackagesArchive }}
- name: install node
uses: actions/setup-node@v2
with:
node-version: '16.x'

- name: Pack into single file executable
run: |
cd .\.github\utils\
npm install
node pack.js
cd -
Move-Item build\SduNetCheckTool.GUI_boxed.exe build\${{ env.appPackagesExecutable }}
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: my-artifact
name: ${{ env.artifactName }}
path: |
build/${{ env.appPackagesArchive }}
build/SduNetCheckTool.GUI_boxed.exe
retention-days: 5
build/${{ env.appPackagesExecutable }}
retention-days: 1
35 changes: 25 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
# Copyright SduNetCheckTool
# Licensed under the GNU General Public License v3.0

name: Release
name: Build and Release
on:
[release, workflow_dispatch]
release:
types: [created]
# filter on draft releases only

jobs:
build:
uses: ./.github/workflows/build.yml

relase:
needs: build
runs-on: ubuntu-latest

env:
# app 命名 [名字]-[commit-tag]
artifact_name: SduNetCheckTool-${{ github.sha }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.artifact_name }}

- name: Display Artifact
run: |
echo "Building..."
echo "Build complete."
ls -l
mv ${{ env.artifact_name }}.zip SduNetCheckTool-${{ github.ref_name }}.zip
mv ${{ env.artifact_name }}.exe SduNetCheckTool-${{ github.ref_name }}.exe
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
build/${{ env.appPackagesArchive }}
build/SduNetCheckTool.GUI_boxed.exe
SduNetCheckTool-${{ github.ref_name }}.zip
SduNetCheckTool-${{ github.ref_name }}.exe
LICENSE.txt
tag_name: 0.0.1
body: |
This is an automated release of this Wpf application.
tag_name: ${{ github.ref_name }}
draft: false
prerelease: false
token: ${{secrets.GITHUB_TOKEN}}
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test for environment variables

on:
release:
types: [created]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: echo env
run: |
echo "github.event_name = ${{ github.event_name }}"
echo "github.ref = ${{ github.ref }}"
echo "github.ref_name = ${{ github.ref_name }}"
echo "github.sha = ${{ github.sha }}"
echo "github.repository = ${{ github.repository }}"
echo "github.repository_owner = ${{ github.repository_owner }}"
echo "github.run_id = ${{ github.run_id }}"
echo "github.run_number = ${{ github.run_number }}"
echo "github.actor = ${{ github.actor }}"
echo "github.workflow = ${{ github.workflow }}"
echo "github.head_ref = ${{ github.head_ref }}"
echo "github.base_ref = ${{ github.base_ref }}"
echo "github.event_path = ${{ github.event_path }}"
echo "github.workspace = ${{ github.workspace }}"
echo "github.action = ${{ github.action }}"

0 comments on commit 99836b1

Please sign in to comment.