Skip to content

Commit

Permalink
continue
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed May 20, 2024
1 parent a345a32 commit 03a8ab3
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/deno_config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Imports
import { expandGlob } from "jsr:@std/fs"
import { fromFileUrl } from "jsr:@std/path/from-file-url"
import { resolve } from "jsr:@std/path/resolve"
Expand Down
25 changes: 25 additions & 0 deletions .github/deno_tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Imports
import { fromFileUrl } from "jsr:@std/path/from-file-url"
import { resolve } from "jsr:@std/path/resolve"
import * as JSONC from "jsr:@std/jsonc"
import { parseArgs } from "@std/cli"
import type { record } from "jsr:@libs/typing"
import * as semver from "@std/semver"
import { assert } from "@std/assert"

// Parse arguments
const { version, _: [name] } = parseArgs(Deno.args, { string: ["version"] })
assert(version, "missing --version argument")
assert(name, "missing package name argument")

// Resolve config path
const path = resolve(fromFileUrl(import.meta.resolve("../")), `${name}`, "deno.jsonc")
console.log(`patching: ${path}`)

// Patch config version
const config = JSONC.parse(await Deno.readTextFile(path)) as record<string>
const { version: previous } = config
config.version = version
console.log(`version: ${previous}${version}`)
await Deno.writeTextFile(path, JSON.stringify(config, null, 2))
assert(semver.greaterThan(semver.parse(version), semver.parse(previous)), "expected new version to be grater than previous one")
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,16 @@ jobs:
with:
tag-prefix: ${{ matrix.package }}-
scope: ${{ matrix.package }}
# - run: |
# if [ ! -z "${{ steps.calculate_next_version.outputs.tag }}" ]; then


# echo "Next tag: ${{ steps.calculate_next_version.outputs.tag }}"
# echo "::set-output name=tag::${{ steps.calculate_next_version.outputs.tag }}"
# else
# echo ""
# fi
- uses: denoland/setup-deno@v1
- if: ${{ steps.calculate_next_version.outputs.tag }}
shell: bash
run: |
deno task tag --version '${{ steps.calculate_next_version.outputs.tag }}' ${{ matrix.package }}
deno fmt ${{ matrix.package }}/deno.jsonc
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git tag '${{ steps.calculate_next_version.outputs.tag }}'
git push origin '${{ steps.calculate_next_version.outputs.tag }}'
publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand Down
1 change: 1 addition & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "MIT License",
"tasks": {
"config": "deno run --allow-read=. --allow-write=. .github/deno_config.ts && deno fmt",
"tag": "deno run --allow-read --allow-write=. .github/deno_tag.ts",
"ci": "deno task bundle:ci && deno task crypto:ci && deno task diff:ci && deno task logger:ci && deno task qrcode:ci && deno task reactive:ci && deno task testing:ci && deno task typing:ci && deno task xml:ci",
"bundle:ci": "cd bundle && deno task ci",
"bundle:publish": "cd bundle && deno publish",
Expand Down
7 changes: 7 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 03a8ab3

Please sign in to comment.