Skip to content
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

github controller #8

Merged
merged 24 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
name-template: "$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"
categories:
- title: '🚀 Features'
- title: "🚀 Features"
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
- "feature"
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
- "fix"
- "bugfix"
- "bug"
- title: "🧰 Maintenance"
label: "chore"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
- "major"
minor:
labels:
- 'minor'
- "minor"
patch:
labels:
- 'patch'
- "patch"
default: patch
template: |
## Changes

$CHANGES
$CHANGES
15 changes: 8 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: check
on:
pull_request:
branches: [ main ]
branches: [main]
push:
branches: [ main ]
branches: [main]

jobs:
check:
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v1.x
deno-version: v2.x

- run: deno fmt --check
- run: deno lint
- run: deno cache deps/mod.ts
- run: deno test
- run: npx jsr publish --dry-run
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:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4
- run: npx jsr publish
67 changes: 58 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,71 @@ on:
branches:
- main

# pull_request event is required only for autolabeler
pull_request:
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
draft-release:
name: Draft Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
resolved_version: ${{ steps.release.outputs.resolved_version }}
steps:
- id: release
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

update-version:
needs: draft-release
name: Update Version
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: release-drafter/release-drafter@v5
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.AUTOMATION_APP_ID }}
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}

- uses: optum/semver-cli/setup@main
with:
version: 0.9.7
token: ${{ steps.app-token.outputs.token }}

- name: Set Version
run: |
semver set ${{ needs.draft-release.outputs.resolved_version }}
if [ -z $(git status --porcelain) ];
then
echo "no changes to commit."
exit 0
fi

cat >> $GITHUB_STEP_SUMMARY<<EOF
# Version
\`\`\`
${{ needs.draft-release.outputs.resolved_version }}
\`\`\`
EOF

git config user.name bustin-base[bot]
git config user.email 177288331+bustin-base[bot]@users.noreply.github.com
gh auth setup-git

git add .
git commit -m '${{ needs.draft-release.outputs.resolved_version }}[no ci]'
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
19 changes: 18 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
{
"name": "@justinmchase/grove",
"version": "0.1.0",
"exports": "./mod.ts",
"tasks": {
"check": "deno fmt && deno lint && deno test",
"check": "deno fmt && deno lint && deno test && npx jsr publish --dry-run --allow-dirty",
"example": "deno run -A example/main.ts",
"example:web": "deno run -A example/main.ts web",
"example:job": "deno run -A example/main.ts job",
"example:job:hello": "deno run -A example/main.ts job hello",
"watch:test": "deno test src --watch",
"watch:example:web": "deno run --watch -A example/main.ts"
},
"imports": {
"@cliffy/command": "jsr:@cliffy/command@^1.0.0-rc.7",
"@db/mongo": "jsr:@db/mongo@^0.33.0",
"@justinmchase/github-api": "jsr:@justinmchase/github-api@^0.5.11",
"@justinmchase/serializable": "jsr:@justinmchase/serializable@^0.3.13",
"@justinmchase/type": "jsr:@justinmchase/type@^0.2.4",
"@oak/oak": "jsr:@oak/oak@^17.1.3",
"@std/assert": "jsr:@std/assert@^1.0.7",
"@std/dotenv": "jsr:@std/dotenv@^0.225.2",
"@std/encoding": "jsr:@std/encoding@^1.0.5",
"@std/fmt": "jsr:@std/fmt@^1.0.3",
"@std/testing": "jsr:@std/testing@^1.0.4",
"@wok/case": "jsr:@wok/case@^1.0.1"
}
}
Loading
Loading