Skip to content

Commit

Permalink
upgrade to work with deno 2 (#83)
Browse files Browse the repository at this point in the history
* upgrade to work with deno 2

* refactor lint error, remove duplicate exit code field

* use correct error in tests

* use deno 2 in lock file

* update yargs

* fix checks

* Update .github/workflows/sourcehawk-scan.yml

Co-authored-by: Richard Slayman <[email protected]>

---------

Co-authored-by: Richard Slayman <[email protected]>
  • Loading branch information
justinmchase and rslayman authored Nov 11, 2024
1 parent 7f3d10e commit 1985841
Show file tree
Hide file tree
Showing 22 changed files with 214 additions and 734 deletions.
33 changes: 16 additions & 17 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
name-template: "$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"
categories:
- title: '🚀 Features'
- title: "🚀 Features"
labels:
- breaking
- enhancement
- feature
- new-feature
- breaking-change
- title: '🐛 Bug Fixes'
- title: "🐛 Bug Fixes"
labels:
- bug
- hotfix
- title: '🧰 Maintenance'
- title: "🧰 Maintenance"
labels:
- documentation
- maintenance
- dependencies
- performance
- refactor
- ci
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
version-resolver:
major:
labels:
Expand All @@ -38,26 +38,25 @@ version-resolver:
- hotfix
default: patch
autolabeler:
- label: 'documentation'
- label: "documentation"
files:
- '**/*.md'
- label: 'bug'
- "**/*.md"
- label: "bug"
branch:
- '/(hot)?fix\/.+/i'
title:
- '/fix/i'
- label: 'feature'
- "/fix/i"
- label: "feature"
branch:
- '/feature\/.+/'
- label: 'ci'
- label: "ci"
files:
- '.github/workflows/*.yml'
- label: 'dependencies'
- ".github/workflows/*.yml"
- label: "dependencies"
files:
- 'deps/*.ts'
- 'deno.lock'
- "deps/*.ts"
- "deno.lock"
template: |
## Changes
$CHANGES
2 changes: 1 addition & 1 deletion .github/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:
pattern: '(?<=VERSION=).*(?=; \\)'
- kind: regexp
file: setup/action.yml
pattern: '(?<=default: ).*'
pattern: "(?<=default: ).*"
33 changes: 27 additions & 6 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ name: Checks
on:
workflow_dispatch:
pull_request:
branches: [ main ]
branches: [main]
push:
branches: [ main, 'version/*' ]
branches: [main, "version/*"]

jobs:
check:
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: v2.x

- run: deno --version
- run: deno fmt --check
Expand Down Expand Up @@ -47,8 +47,29 @@ jobs:
EOF
action:
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: ./setup
- run: semver get
with:
version: 0.9.5
- run: semver parse

docker:
runs-on: ubuntu-latest
needs: action
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build
uses: docker/build-push-action@v4
with:
push: false
tags: optum/semver-cli:pr
platforms: linux/amd64
16 changes: 8 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:
strategy:
matrix:
target:
- name: "x86_64-unknown-linux-gnu"
extension: ""
- name: "x86_64-pc-windows-msvc"
extension: ".exe"
- name: "x86_64-apple-darwin"
extension: ""
- name: "aarch64-apple-darwin"
extension: ""
- name: "x86_64-unknown-linux-gnu"
extension: ""
- name: "x86_64-pc-windows-msvc"
extension: ".exe"
- name: "x86_64-apple-darwin"
extension: ""
- name: "aarch64-apple-darwin"
extension: ""
needs: version
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/sourcehawk-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Sourcehawk Scan
uses: optum/sourcehawk-scan-github-action@main



2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN mkdir -p /app/bin
COPY deps/ /app/deps
COPY deno.json /app/
COPY deno.lock /app/
RUN deno cache --lock-write deps/mod.ts
RUN deno cache --allow-import deps/mod.ts

# These steps will be re-run upon any file change in your working directory:
ADD src /app/src
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ on:
# Updates both package.json and package-lock.json
- kind: patch
file: package.json

# Uses non-matching groups to isolate the version to replace.
- kind: regexp
file: src/info.js
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tasks": {
"check": "deno fmt && deno lint && deno test",
"check": "deno fmt && deno lint && deno task test",
"install": "deno install --allow-run --allow-env --allow-read --allow-write -f main.ts -n semver",
"test": "deno test && deno task test:node && deno task test:helm && deno task test:maven && deno task test:dotnet",
"test:node": "(cd test/node && deno run -A ../../main.ts inc minor --pre --name alpha --build xyz.987)",
Expand Down
Loading

0 comments on commit 1985841

Please sign in to comment.