Skip to content

Commit

Permalink
Merge branch 'main' into magurotuna/subcommand-deploy-import-map
Browse files Browse the repository at this point in the history
  • Loading branch information
magurotuna committed Oct 29, 2024
2 parents 24ec201 + 468aa65 commit 39b2a45
Show file tree
Hide file tree
Showing 59 changed files with 707 additions and 3,817 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
# Test on the oldest supported, the latest stable, and nightly
deno: [old, stable, canary]
os: [macOS-latest, windows-latest, ubuntu-22.04-xl]
os: [macOS-latest, windows-latest, ubuntu-latest]

steps:
# Some test cases are sensitive to line endings. Disable autocrlf on
Expand All @@ -30,7 +30,9 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno == 'old' && '1.41.1' || (matrix.deno == 'stable' && '1.x' || matrix.deno) }}
# Make sure to keep this in sync with the one defined in version.ts.
# Also don't forget to update README.md.
deno-version: ${{ matrix.deno == 'old' && '1.46.0' || (matrix.deno == 'stable' && '2.x' || matrix.deno) }}

- run: deno --version

Expand All @@ -46,10 +48,17 @@ jobs:
if: runner.os == 'Linux' && matrix.deno == 'stable'
run: deno check deployctl.ts

- name: Run tests
run: deno task test
# Skip temporarily (see https://github.com/denoland/deployctl/actions/runs/11500790181/job/32011870448?pr=342#step:8:148)
# - name: action/deps.js up-to-date
# if: runner.os == 'Linux' && matrix.deno == 'stable'
# run: |
# # @deno/emit doesn't work if JSR modules are not in the cache.
# # This is a workaround to cache the JSR modules beforehand.
# deno cache ./src/utils/mod.ts
# deno run --allow-read --allow-env --allow-net ./tools/bundle.ts ./src/utils/mod.ts > ./action/latest.deps.js
# diff ./action/latest.deps.js ./action/deps.js

- name: action/deps.js up-to-date
run: |
deno run --allow-read --allow-env --allow-net ./tools/bundle.ts ./src/utils/mod.ts > ./action/latest.deps.js
diff ./action/latest.deps.js ./action/deps.js
- name: Run tests
# Deno 1.x does not support lockfile v4. To work around this, we append
# `--no-lock` in this case.
run: deno test -A ${{ matrix.deno == 'old' && '--no-lock' || '' }} tests/ src/
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # The OIDC ID token is used for authentication with JSR.
steps:
- uses: actions/checkout@v4
- run: npx jsr publish
16 changes: 11 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ jobs:
root: action/tests
entrypoint: include_exclude.ts
include: include_exclude.ts
- name: Deploy with comma-separated include
- name: Deploy with comma-separated include
uses: ./
with:
project: happy-rat-64
root: action
entrypoint: tests/include_exclude.ts
include: foo,tests/include_exclude.ts,bar
- name: Deploy with comma-separated exclude
include: foo, tests/include_exclude.ts,bar
- name: Deploy with comma-separated exclude
uses: ./
with:
project: happy-rat-64
root: action/tests
entrypoint: include_exclude.ts
exclude: import_bomb1,import_bomb2
- name: Deploy with multiline exclude
- name: Deploy with multiline exclude
uses: ./
with:
project: happy-rat-64
Expand Down Expand Up @@ -74,4 +74,10 @@ jobs:
with:
project: happy-rat-64
root: action/tests
entrypoint: always_exclude_node_modules/main.ts
entrypoint: always_exclude_node_modules/main.ts
- name: data URL entrypoint
uses: ./
with:
project: happy-rat-64
root: action/tests
entrypoint: "data:,Deno.serve(() => new Response())"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ contains the `denoland/deployctl` GitHub Action.

## Prerequisite

You need to have Deno 1.41.1+ installed (latest version is recommended; just run
You need to have Deno 1.46.0+ installed (latest version is recommended; just run
`deno upgrade`)

## Install

```shell
deno install -Arf jsr:@deno/deployctl
deno install -gArf jsr:@deno/deployctl
```

## Usage
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Deploy to Deno Deploy
uses: denoland/deployctl@v1
Expand Down
2 changes: 1 addition & 1 deletion action/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
id-token: write # required
contents: read
steps:
# your steps here...
# your steps here...
```

### Inputs
Expand Down
Loading

0 comments on commit 39b2a45

Please sign in to comment.