diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 0000000..32101c1 --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,54 @@ +name: MSBuild and Release + +on: + push: + tags: + - "v*.*.*" + +env: + SOLUTION_FILE_PATH: . + BUILD_CONFIGURATION: Release + +permissions: + contents: write + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4.1.7 + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Restore NuGet packages + working-directory: ${{env.GITHUB_WORKSPACE}} + run: nuget restore ${{env.SOLUTION_FILE_PATH}} + + - name: Build x64 + working-directory: ${{env.GITHUB_WORKSPACE}} + run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=x64 ${{env.SOLUTION_FILE_PATH}} + + - name: Build x86 + working-directory: ${{env.GITHUB_WORKSPACE}} + run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=x86 ${{env.SOLUTION_FILE_PATH}} + + - name: Compress x64 Output + run: Compress-Archive -Path .\x64\Release\ -DestinationPath Release-x64.zip + shell: pwsh + + - name: Compress x86 Output + run: Compress-Archive -Path .\Release\ -DestinationPath Release-x86.zip + shell: pwsh + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v2.0.8 + with: + files: | + Release-x64.zip + Release-x86.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index b79deed..5d6d326 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -8,12 +8,7 @@ on: branches: [ "stable" ] env: - # Path to the solution file relative to the root of the project. SOLUTION_FILE_PATH: . - - # Configuration type to build. - # You can convert this to a build matrix if you need coverage of multiple configuration types. - # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix BUILD_CONFIGURATION: Release permissions: @@ -24,10 +19,11 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4.1.7 - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v2 - name: Restore NuGet packages working-directory: ${{env.GITHUB_WORKSPACE}} @@ -35,25 +31,22 @@ jobs: - name: Build x64 working-directory: ${{env.GITHUB_WORKSPACE}} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=x64 ${{env.SOLUTION_FILE_PATH}} - name: Build x86 working-directory: ${{env.GITHUB_WORKSPACE}} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=x86 ${{env.SOLUTION_FILE_PATH}} - - name: Archive Builds - working-directory: ${{env.GITHUB_WORKSPACE}} - run: powershell.exe ./package.ps1 - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3.1.2 + - name: Upload x86 Build Artifact + uses: actions/upload-artifact@v4.4.0 + with: + name: Release-x86 + path: .\Release + if-no-files-found: error + + - name: Upload x64 Build Artifact + uses: actions/upload-artifact@v4.4.0 with: - # Artifact name - name: AutoBuild - # A file, directory or wildcard pattern that describes what to upload - path: Release.zip - # The desired behavior if no files are found using the provided path. + name: Release-x64 + path: .\x64\Release\ + if-no-files-found: error diff --git a/CasioEmuMsvc.sln b/CasioEmuMsvc.sln index 5105766..1843816 100644 --- a/CasioEmuMsvc.sln +++ b/CasioEmuMsvc.sln @@ -14,7 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决 convert_all_lua_config.ps1 = convert_all_lua_config.ps1 GB2UTF8.ps1 = GB2UTF8.ps1 LICENSE = LICENSE - package.ps1 = package.ps1 README.md = README.md EndProjectSection EndProject diff --git a/README.md b/README.md index 3f07f98..40fab37 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![CasioEmuMsvc](https://socialify.git.ci/Physics365/CasioEmuMsvc/image?description=1&descriptionEditable=Msvc%20version%20of%20CasioEmu%0AA%20fork%20of%20telecomadm1145%2FCasioEmuMsvc&font=Source%20Code%20Pro&forks=1&issues=1&language=1&logo=https%3A%2F%2Fi.ibb.co%2FFg833j1%2FOIP-removebg-preview-333.png&name=1&owner=1&pattern=Plus&pulls=1&stargazers=1&theme=Auto) + # CasioEmuMsvc An emulator for nX-U16/100 MCU (and nX-U8/100 MCU as well). @@ -10,4 +12,4 @@ With debugger and built-in disassembler. * Clone this repo -* Build with VS or using `msbuild` \ No newline at end of file +* Build with VS or using `msbuild` diff --git a/package.ps1 b/package.ps1 deleted file mode 100644 index 1c53a47..0000000 --- a/package.ps1 +++ /dev/null @@ -1,12 +0,0 @@ - -mkdir ".\ReleasePackage" - -mkdir ".\ReleasePackage\x86" -cp -Recurse .\Release\* .\ReleasePackage\x86 - -mkdir ".\ReleasePackage\x64" -cp -Recurse .\x64\Release\* .\ReleasePackage\x64 - -(".\ReleasePackage\x64",".\ReleasePackage\x86") | Compress-Archive -DestinationPath Release.zip -Force - -del -Recurse ReleasePackage \ No newline at end of file