-
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.
fixes for windows paths and binary names
- Loading branch information
Adam McKee
committed
Dec 21, 2024
1 parent
4b70fd4
commit 1a4a9d9
Showing
9 changed files
with
133 additions
and
40 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Upload Windows | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
release_id: | ||
required: true | ||
type: string | ||
tag_name: | ||
required: true | ||
type: string | ||
upload_hostname: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
|
||
publish-asset: | ||
runs-on: windows-2022 | ||
strategy: | ||
matrix: | ||
include: | ||
- filename: l3-windows-aarch64.exe | ||
target: aarch64-pc-windows-msvc | ||
- filename: l3-windows-x86_64.exe | ||
target: x86_64-pc-windows-msvc | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.tag_name }} | ||
- run: rustup install stable | ||
- run: rustup target add ${{ matrix.target }} | ||
- name: build | ||
shell: powershell | ||
run: cargo build -p l3_cli --release --target ${{ matrix.target }} | ||
- name: upload | ||
shell: powershell | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
RELEASE_ID: ${{ inputs.release_id }} | ||
UPLOAD_HOSTNAME: ${{ inputs.upload_hostname }} | ||
run: | | ||
Move-Item -Path target\${{ matrix.target }}\release\l3.exe -Destination ${{ matrix.filename }} | ||
Move-Item -Path .github/workflows/windows_upload_asset.mjs -Destination upload_asset.mjs | ||
npm i @octokit/core | ||
node upload_asset.mjs eighty4 l3 $env:RELEASE_ID ${{ matrix.filename }} application/x-dosexec $env:UPLOAD_HOSTNAME |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const owner = process.argv[2] | ||
const repo = process.argv[3] | ||
const releaseId = process.argv[4] | ||
const filename = process.argv[5] | ||
const contentType = process.argv[6] | ||
const baseUrl = 'https://' + process.argv[7] | ||
|
||
import {Octokit} from '@octokit/core' | ||
|
||
const auth = process.env.GH_TOKEN | ||
|
||
const url = `POST /repos/${owner}/${repo}/releases/${releaseId}/assets?name=${filename}` | ||
|
||
const options = { | ||
baseUrl, | ||
owner, | ||
repo, | ||
release_id: releaseId, | ||
data: '@' + filename, | ||
headers: { | ||
'Accept': 'application/vnd.github+json', | ||
'Content-Type': contentType, | ||
'X-GitHub-Api-Version': '2022-11-28', | ||
}, | ||
} | ||
|
||
new Octokit({auth}).request(url, options) | ||
.then(() => console.log('finished')) | ||
.catch((e) => { | ||
console.error(e) | ||
process.exit(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
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
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