Skip to content

Commit

Permalink
增加 Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
xrgzs committed Apr 8, 2024
1 parent c51c562 commit aadae75
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 9 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,8 @@ jobs:
run: |
cmd /c build.bat
- name: Create Release and Upload Asset
uses: softprops/action-gh-release@v2
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
tag_name: v${{ steps.generate_version.outputs.version }}
name: v${{ steps.generate_version.outputs.version }}
draft: false
prerelease: true
generate_release_notes: true
token: ${{ secrets.MY_TOKEN }}
files: osc.exe
name: XRSYS_OSC_CI_Build
path: osc.exe
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build

on:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Generate version based on current date and time
id: generate_version
shell: pwsh
run: |
Set-TimeZone -Id "China Standard Time" -PassThru
$date = Get-Date
$year = $date.Year.ToString().Substring(2)
$month = $date.Month.ToString("0")
$day = $date.Day.ToString("0")
$hour = $date.Hour.ToString("0")
$minute = $date.Minute.ToString("0")
$version = "$year.$month.$day.$hour$minute"
echo "Version: $version"
echo $PSVersionTable
echo $GITHUB_OUTPUT
echo "version=$version" >> $env:GITHUB_OUTPUT
- name: Install NSIS
uses: repolevedavaj/[email protected]
with:
nsis-version: 3.09

- name: Build XROSC
shell: cmd
env:
GITHUB_WORKFLOW_VERSION: ${{ steps.generate_version.outputs.version }}
run: |
cmd /c build.bat
- name: Create Release and Upload Asset
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.generate_version.outputs.version }}
name: v${{ steps.generate_version.outputs.version }}
draft: false
prerelease: true
generate_release_notes: true
token: ${{ secrets.MY_TOKEN }}
files: osc.exe

0 comments on commit aadae75

Please sign in to comment.