-
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.
Merge pull request #24 from metrik-tech/feature/ENG-172
ENG-172: add support for publishing SDK to metrik S3 server upon new …
- Loading branch information
Showing
4 changed files
with
59 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
on: | ||
push: | ||
branches: [ "*" ] | ||
|
||
jobs: | ||
upload-artifact: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: ok-nick/[email protected] | ||
- name: Build artifact dependencies | ||
run: wally install | ||
- name: Build artifact | ||
run: rojo build default.project.json -o Artifact.rbxm | ||
- name: Deploy artifact | ||
run: lune run deploy Artifact.rbxm |
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,37 @@ | ||
local process = require("@lune/process") | ||
local net = require("@lune/net") | ||
local fs = require("@lune/fs") | ||
|
||
local artifact = process.args[1] | ||
local commitHash = process.env.GITHUB_SHA | ||
local authorization = process.env.SDK_ARTIFACT_UPLOAD_SECRET | ||
|
||
local multiformUuid = `SDK_WORKFLOW.{math.random()}` | ||
local multiformContentBoundary = `{multiformUuid}` | ||
local multiformContent = "" | ||
|
||
multiformContent ..= `--{multiformContentBoundary}\r\n` | ||
multiformContent ..= `Content-Disposition: form-data; name="commitHash"\r\n` | ||
multiformContent ..= `Content-Type: application/json\r\n` | ||
|
||
multiformContent ..= `\r\n` | ||
multiformContent ..= `{commitHash}\r\n` | ||
|
||
multiformContent ..= `--{multiformContentBoundary}\r\n` | ||
multiformContent ..= `Content-Disposition: form-data; name="file"; filename="file.rbxm"\r\n` | ||
multiformContent ..= `Content-Type: application/octet-stream\r\n` | ||
|
||
multiformContent ..= `\r\n` | ||
multiformContent ..= `{fs.readFile(artifact)}\r\n` | ||
|
||
multiformContent ..= `--{multiformContentBoundary}--\r\n` | ||
|
||
print(net.request({ | ||
url = "https://preview.metrik.app/api/sdk/upload-artifact", | ||
method = "POST", | ||
headers = { | ||
["Authorization"] = `Bearer {authorization}`, | ||
["content-type"] = `multipart/form-data; boundary={multiformContentBoundary}` | ||
}, | ||
body = multiformContent | ||
})) |
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,3 +1,7 @@ | ||
{ | ||
"luau-lsp.sourcemap.rojoProjectFile": "development.project.json" | ||
"luau-lsp.sourcemap.rojoProjectFile": "development.project.json", | ||
"luau-lsp.require.mode": "relativeToFile", | ||
"luau-lsp.require.directoryAliases": { | ||
"@lune/": "~/.lune/.typedefs/0.8.6/" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ wally = "UpliftGames/[email protected]" | |
wally-package-types = "JohnnyMorganz/[email protected]" | ||
luaulsp = "JohnnyMorganz/[email protected]" | ||
zap = "red-blox/[email protected]" | ||
lune = "lune-org/[email protected]" |