Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7250ec8c58 | |||
| 8a4eea282f | |||
| d63ce05d83 | |||
| ec9cf435ca | |||
| 580330b99e | |||
| d32fa5c91f | |||
| acdeadb06a | |||
| f3bf4a4954 | |||
| 20c962c711 | |||
| 59164c89a0 |
@@ -12,17 +12,13 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Rust stable
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
targets: x86_64-pc-windows-msvc
|
|
||||||
|
|
||||||
- name: Build release binary
|
- name: Build release binary
|
||||||
|
shell: powershell
|
||||||
run: cargo build --release
|
run: cargo build --release
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
id: create_release
|
id: create_release
|
||||||
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$tag = "${{ github.ref_name }}"
|
$tag = "${{ github.ref_name }}"
|
||||||
$body = @{
|
$body = @{
|
||||||
@@ -42,18 +38,23 @@ jobs:
|
|||||||
} `
|
} `
|
||||||
-Body $body
|
-Body $body
|
||||||
|
|
||||||
echo "release_id=$($response.id)" >> $env:GITHUB_OUTPUT
|
"release_id=$($response.id)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
||||||
|
|
||||||
- name: Upload binary asset
|
- name: Upload binary asset
|
||||||
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$releaseId = "${{ steps.create_release.outputs.release_id }}"
|
$releaseId = "${{ steps.create_release.outputs.release_id }}"
|
||||||
$filePath = "target\release\tickr.exe"
|
$filePath = (Resolve-Path "target\release\tickr.exe").Path
|
||||||
|
|
||||||
Invoke-RestMethod `
|
Write-Host "Working dir: $(Get-Location)"
|
||||||
-Uri "https://gitea.whitlocktech.com/api/v1/repos/whitlocktech/tickr/releases/$releaseId/assets?name=tickr.exe" `
|
Write-Host "Release ID: $releaseId"
|
||||||
-Method Post `
|
Write-Host "File: $filePath"
|
||||||
-Headers @{
|
|
||||||
Authorization = "token ${{ secrets.RELEASE_TOKEN }}"
|
if (!(Test-Path $filePath)) {
|
||||||
} `
|
Write-Error "File not found: $filePath"
|
||||||
-InFile $filePath `
|
exit 1
|
||||||
-ContentType "application/octet-stream"
|
}
|
||||||
|
|
||||||
|
$uri = "https://gitea.whitlocktech.com/api/v1/repos/whitlocktech/tickr/releases/$releaseId/assets?name=tickr.exe"
|
||||||
|
|
||||||
|
& curl.exe -X POST -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" -F "attachment=@`"$filePath`"" "$uri"
|
||||||
Reference in New Issue
Block a user