This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
forked from SDUQD-SNA/SduNetCheckTool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
74 additions
and
29 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
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 |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 |
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 |
---|---|---|
@@ -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}} |
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,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 }}" | ||