-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Deno binary compilation #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jwulf
wants to merge
1
commit into
main
Choose a base branch
from
deno-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,101 @@ | ||
| name: Deno Binaries | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-linux: | ||
| name: Build (Linux) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Deno | ||
| uses: denoland/setup-deno@v1 | ||
| with: | ||
| deno-version: v2.x | ||
|
|
||
| - name: Slim package.json (prod deps only) | ||
| run: | | ||
| mv package.json package.full.json | ||
| deno eval "const p = JSON.parse(await Deno.readTextFile('package.full.json')); const out = { name: p.name, version: p.version, private: true, type: p.type, dependencies: p.dependencies }; await Deno.writeTextFile('package.json', JSON.stringify(out, null, 2) + '\n');" | ||
|
|
||
| - name: Compile | ||
| run: | | ||
| deno task compile:linux-x64 | ||
| deno task compile:linux-arm64 | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: deno-binaries-linux | ||
| path: dist-deno/* | ||
|
|
||
| build-macos: | ||
| name: Build (macOS) | ||
| runs-on: macos-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Deno | ||
| uses: denoland/setup-deno@v1 | ||
| with: | ||
| deno-version: v2.x | ||
|
|
||
| - name: Slim package.json (prod deps only) | ||
| run: | | ||
| mv package.json package.full.json | ||
| deno eval "const p = JSON.parse(await Deno.readTextFile('package.full.json')); const out = { name: p.name, version: p.version, private: true, type: p.type, dependencies: p.dependencies }; await Deno.writeTextFile('package.json', JSON.stringify(out, null, 2) + '\n');" | ||
|
|
||
| - name: Compile | ||
| run: | | ||
| deno task compile:mac-x64 | ||
| deno task compile:mac-arm64 | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: deno-binaries-macos | ||
| path: dist-deno/* | ||
|
|
||
| upload-release-assets: | ||
| name: Upload Release Assets | ||
| runs-on: ubuntu-latest | ||
| needs: [build-linux, build-macos] | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Download Linux artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: deno-binaries-linux | ||
| path: dist-deno | ||
|
|
||
| - name: Download macOS artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: deno-binaries-macos | ||
| path: dist-deno | ||
|
|
||
| - name: Generate checksums | ||
| run: | | ||
| cd dist-deno | ||
| sha256sum * > SHA256SUMS.txt | ||
|
|
||
| - name: Upload to GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: dist-deno/* | ||
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||||||
| // c8ctl-plugin.ts | ||||||
|
||||||
| // c8ctl-plugin.ts | |
| // c8ctl-plugin.js |
This file contains hidden or 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,13 @@ | ||
| { | ||
| "name": "demo-plugin", | ||
| "version": "1.0.0", | ||
| "description": "Demonstration plugin for c8ctl", | ||
| "license": "ISC", | ||
| "author": "", | ||
| "type": "module", | ||
| "main": "c8ctl-plugin.js", | ||
| "keywords": ["c8ctl-plugin"], | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| } | ||
| } |
This file contains hidden or 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,15 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "lib": ["es2023", "dom"] | ||
| }, | ||
| "tasks": { | ||
| "check": "deno check --no-lock src/deno.ts", | ||
|
|
||
| "compile:mac-x64": "mkdir -p dist-deno && deno compile --no-lock --no-check --allow-net --allow-env --allow-sys --allow-read --allow-write --allow-run --target x86_64-apple-darwin --output dist-deno/c8ctl-macos-x64 src/deno.ts", | ||
| "compile:mac-arm64": "mkdir -p dist-deno && deno compile --no-lock --no-check --allow-net --allow-env --allow-sys --allow-read --allow-write --allow-run --target aarch64-apple-darwin --output dist-deno/c8ctl-macos-arm64 src/deno.ts", | ||
| "compile:linux-x64": "mkdir -p dist-deno && deno compile --no-lock --no-check --allow-net --allow-env --allow-sys --allow-read --allow-write --allow-run --target x86_64-unknown-linux-gnu --output dist-deno/c8ctl-linux-x64 src/deno.ts", | ||
| "compile:linux-arm64": "mkdir -p dist-deno && deno compile --no-lock --no-check --allow-net --allow-env --allow-sys --allow-read --allow-write --allow-run --target aarch64-unknown-linux-gnu --output dist-deno/c8ctl-linux-arm64 src/deno.ts", | ||
|
|
||
| "compile:all": "deno task compile:mac-x64 && deno task compile:mac-arm64 && deno task compile:linux-x64 && deno task compile:linux-arm64" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checksum generation command
sha256sum * > SHA256SUMS.txtwill include SHA256SUMS.txt in the glob pattern on subsequent runs if the step is re-executed, which could cause issues. Additionally, the SHA256SUMS.txt file itself will be uploaded to the release, and then sha256sum will attempt to hash it along with the binaries. Consider using a more specific pattern likesha256sum c8ctl-* > SHA256SUMS.txtto only hash the actual binaries and exclude the checksum file itself.