Skip to content

Commit

Permalink
chore: Update GitHub Actions workflows and build script
Browse files Browse the repository at this point in the history
- Upgrade actions/checkout to v4
- Update Deno version to 1.41.0 in test-build workflow
- Add permissions for pull-requests in test-build workflow
- Add --allow-run=gh to build script for GitHub CLI access
- Exit with error if any build fails

BREAKING CHANGE: The minimum required Deno version is now 1.41.0
  • Loading branch information
sidedwards committed Oct 27, 2024
1 parent eb9ab52 commit 98f2949
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@ on:
pull_request:
branches: [ main, master ]

permissions:
contents: read
pull-requests: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: "1.37.0"
deno-version: "1.41.0"

- name: Run Tests
run: deno test -A

- name: Test Build
run: |
rm -f deno.lock
deno cache main.ts
deno task build
4 changes: 2 additions & 2 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function build() {
"--allow-read",
"--allow-write",
"--allow-env",
"--allow-run=git,vim",
"--allow-run=git,vim,gh", // Added gh for GitHub CLI
"--target",
target.target,
"--output",
Expand All @@ -60,7 +60,7 @@ async function build() {
const result = await command.output();
if (!result.success) {
console.error(`Failed to build for ${target.platform}`);
continue;
Deno.exit(1); // Exit with error if any build fails
}
}

Expand Down

0 comments on commit 98f2949

Please sign in to comment.