-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
502 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
#!/usr/bin/env -S tea -E | ||
#!/usr/bin/env -S pkgx +npm deno run --allow-env --allow-read --allow-write --allow-net --allow-run | ||
|
||
/*--- | ||
args: | ||
- deno | ||
- run | ||
- --allow-env | ||
- --allow-read | ||
- --allow-write | ||
- --allow-net | ||
- --allow-run | ||
dependencies: | ||
npmjs.com: '*' | ||
---*/ | ||
|
||
import { build, emptyDir } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { build, emptyDir } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import SemVer from "../src/utils/semver.ts"; | ||
|
||
await emptyDir("./dist"); | ||
|
@@ -46,24 +33,24 @@ await build({ | |
"./src/utils/flock.deno.ts": "./src/utils/flock.node.ts" | ||
}, | ||
package: { | ||
name: "@teaxyz/lib", | ||
name: "libpkgx", | ||
version, | ||
description: "pkging primitives", | ||
license: "Apache-2.0", | ||
repository: { | ||
type: "git", | ||
url: "git://github.com/teaxyz/lib.git", | ||
url: "git://github.com/pkgxdev/lib.git", | ||
}, | ||
bugs: { | ||
url: "https://github.com/teaxyz/lib/issues", | ||
url: "https://github.com/pkgxdev/lib/issues", | ||
}, | ||
dependencies: { | ||
"is-what": "^4", | ||
"outdent": "^0.8", | ||
}, | ||
exports: { | ||
"./src/src/utils/semver": { | ||
//TODO remove when gui is updated to use `@teaxyz/lib/semver` | ||
//TODO remove when gui is updated to use `libpkgx/semver` | ||
import: "./src/src/utils/semver.ts" | ||
}, | ||
"./semver": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: cd·npm | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
concurrency: | ||
group: cd/vx/${{ github.event.release.tag_name }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
npm-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: robinraju/[email protected] | ||
with: | ||
releaseId: ${{ github.event.release.id }} | ||
|
||
- run: | | ||
mkdir dist | ||
tar xf *.tar.xz --directory=dist --strip-components=1 | ||
# if we don’t do this the npm publish step doesn’t work | ||
- uses: actions/setup-node@v2 | ||
with: | ||
registry-url: https://registry.npmjs.org | ||
|
||
- run: npm publish --access public | ||
working-directory: dist | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: cd·vx | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
concurrency: | ||
group: cd/vx/${{ github.event.release.tag_name }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
retag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: fischerscode/tagger@v0 | ||
with: | ||
prefix: v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,53 @@ | ||
name: CD | ||
name: cd | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
- edited | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.event.release.tag_name }} | ||
group: v${{ inputs.version }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check: | ||
if: ${{ github.event.release.prerelease }} | ||
uses: ./.github/workflows/ci.yml | ||
|
||
dnt: | ||
needs: [check] | ||
qa: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- [self-hosted, macOS, X64] | ||
- [self-hosted, linux, X64] | ||
- [self-hosted, macOS, ARM64] | ||
- [self-hosted, linux, ARM64] | ||
- ubuntu-latest # ∵ resilience: PRs verify dnt with this env | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: teaxyz/setup@v0 | ||
- run: deno task dnt ${{ github.event.release.name }} | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
with: | ||
path: dist | ||
- uses: actions/checkout@v4 | ||
- uses: pkgxdev/dev@v0 | ||
- run: deno task dnt | ||
|
||
publish-npm: | ||
needs: [dnt] | ||
attach: | ||
runs-on: ubuntu-latest | ||
needs: qa | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
|
||
# if we don’t do this the npm publish step doesn’t work | ||
- uses: actions/setup-node@v2 | ||
with: | ||
registry-url: https://registry.npmjs.org | ||
- uses: actions/checkout@v4 | ||
- uses: pkgxdev/dev@v0 | ||
|
||
- run: npm publish --access public | ||
working-directory: artifact | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- run: deno task dnt ${{ inputs.version }} | ||
|
||
publish: | ||
needs: [publish-npm] | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Convert pre-release to release | ||
run: | | ||
curl -fX PATCH \ | ||
-H "Authorization: Bearer ${{ github.token }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-d '{"draft": false, "prerelease": false, "make_latest": true, "tag_name": "${{ github.event.release.name }}"}' \ | ||
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}" | ||
# delete pre-release tag | ||
- run: | | ||
git push origin :${{ github.event.release.tag_name }} | ||
git tag -d ${{ github.event.release.tag_name }} | ||
# we need the new tag for the next step | ||
- run: git fetch origin --tags | ||
|
||
- uses: fischerscode/tagger@v0 | ||
with: | ||
prefix: v | ||
tag: ${{ github.event.release.name }} | ||
mv dist libpkgx-${{inputs.version}} | ||
tar cJf libpkgx-${{ inputs.version }}.tar.xz libpkgx-${{inputs.version}} | ||
- name: attach to release | ||
run: | ||
gh release upload | ||
--clobber | ||
libpkgx-${{ inputs.version }}.tar.xz | ||
env: | ||
# using this token rather than github.token due to `release not found` bug | ||
# https://github.com/cli/cli/issues/5252 | ||
GH_TOKEN: ${{ secrets.TEMP_JACOBS_GITHUB_PAT }} | ||
GH_REPO: pkgxdev/libpkgx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.