@cbnventures/nova 0.15.4 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/package.json +1 -1
- package/build/src/cli/generate/github/workflows.d.ts +6 -1
- package/build/src/cli/generate/github/workflows.d.ts.map +1 -1
- package/build/src/cli/generate/github/workflows.js +244 -6
- package/build/src/cli/generate/github/workflows.js.map +1 -1
- package/build/src/cli/utility/initialize.d.ts.map +1 -1
- package/build/src/cli/utility/initialize.js +228 -4
- package/build/src/cli/utility/initialize.js.map +1 -1
- package/build/src/lib/nova-config.d.ts.map +1 -1
- package/build/src/lib/nova-config.js +33 -0
- package/build/src/lib/nova-config.js.map +1 -1
- package/build/src/lib/regex.d.ts +4 -0
- package/build/src/lib/regex.d.ts.map +1 -1
- package/build/src/lib/regex.js +4 -0
- package/build/src/lib/regex.js.map +1 -1
- package/build/src/lib/workflow-templates.d.ts.map +1 -1
- package/build/src/lib/workflow-templates.js +176 -113
- package/build/src/lib/workflow-templates.js.map +1 -1
- package/build/src/types/cli/generate/github/workflows.d.ts +178 -0
- package/build/src/types/cli/utility/initialize.d.ts +216 -0
- package/build/src/types/lib/nova-config.d.ts +24 -0
- package/build/src/types/lib/workflow-templates.d.ts +53 -0
- package/build/src/types/shared.d.ts +103 -1
- package/build/src/types/tests/cli/generate/github/workflows-helpers.test.d.ts +54 -0
- package/build/src/types/tests/cli/generate/github/workflows.test.d.ts +12 -2
- package/build/src/types/tests/lib/workflow-templates.test.d.ts +10 -70
- package/build/templates/generators/github/workflows/check-sponsor-gated-issues/base.yml +6 -10
- package/build/templates/generators/github/workflows/check-sponsor-gated-issues/triggers/issue-comment.yml +5 -0
- package/build/templates/generators/github/workflows/check-sponsor-gated-issues/triggers/issues.yml +5 -0
- package/build/templates/generators/github/workflows/lock-inactive-issues/triggers/schedule-daily.yml +5 -0
- package/build/templates/generators/github/workflows/lock-inactive-issues/triggers/schedule-monthly.yml +5 -0
- package/build/templates/generators/github/workflows/{publish-to-cloudflare-pages-docusaurus → publish}/base.yml +8 -17
- package/build/templates/generators/github/workflows/publish/targets/aws-amplify-nextjs.yml +32 -0
- package/build/templates/generators/github/workflows/publish/targets/cloudflare-pages-docusaurus.yml +25 -0
- package/build/templates/generators/github/workflows/publish/targets/docker-hub.yml +47 -0
- package/build/templates/generators/github/workflows/publish/targets/ghcr.yml +47 -0
- package/build/templates/generators/github/workflows/publish/targets/github-packages.yml +84 -0
- package/build/templates/generators/github/workflows/publish/targets/github-pages-docusaurus.yml +43 -0
- package/build/templates/generators/github/workflows/publish/targets/npm.yml +60 -0
- package/build/templates/generators/github/workflows/publish/targets/vercel-nextjs.yml +45 -0
- package/build/templates/generators/github/workflows/{publish-to-npm → publish}/triggers/release.yml +1 -1
- package/build/templates/generators/github/workflows/{publish-to-npm → publish}/triggers/workflow-run-any.yml +1 -1
- package/build/templates/generators/github/workflows/{publish-to-npm → publish}/triggers/workflow-run-failure.yml +1 -1
- package/build/templates/generators/github/workflows/{publish-to-npm → publish}/triggers/workflow-run-success.yml +1 -1
- package/package.json +1 -1
- package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/base.yml +0 -54
- package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/triggers/push.yml +0 -5
- package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/triggers/release.yml +0 -5
- package/build/templates/generators/github/workflows/publish-to-cloudflare-pages-docusaurus/triggers/push.yml +0 -5
- package/build/templates/generators/github/workflows/publish-to-cloudflare-pages-docusaurus/triggers/release.yml +0 -5
- package/build/templates/generators/github/workflows/publish-to-docker-hub/base.yml +0 -59
- package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/release.yml +0 -5
- package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/workflow-run-any.yml +0 -7
- package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/workflow-run-failure.yml +0 -8
- package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/workflow-run-success.yml +0 -8
- package/build/templates/generators/github/workflows/publish-to-github-packages/base.yml +0 -120
- package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/release.yml +0 -5
- package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/workflow-run-any.yml +0 -7
- package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/workflow-run-failure.yml +0 -8
- package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/workflow-run-success.yml +0 -8
- package/build/templates/generators/github/workflows/publish-to-github-pages-docusaurus/base.yml +0 -79
- package/build/templates/generators/github/workflows/publish-to-github-pages-docusaurus/triggers/push.yml +0 -5
- package/build/templates/generators/github/workflows/publish-to-github-pages-docusaurus/triggers/release.yml +0 -5
- package/build/templates/generators/github/workflows/publish-to-npm/base.yml +0 -97
- /package/build/templates/generators/github/workflows/lock-inactive-issues/triggers/{schedule.yml → schedule-weekly.yml} +0 -0
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
name: "Check Sponsor Gated Issues[__WORKFLOW_ID__]"
|
|
2
2
|
|
|
3
|
-
run-name: "
|
|
3
|
+
run-name: "[__RUN_NAME__]"
|
|
4
4
|
|
|
5
5
|
on:
|
|
6
|
-
|
|
7
|
-
types:
|
|
8
|
-
- "created"
|
|
9
|
-
- "edited"
|
|
10
|
-
issues:
|
|
11
|
-
types:
|
|
12
|
-
- "opened"
|
|
13
|
-
- "closed"
|
|
6
|
+
[__TRIGGERS__]
|
|
14
7
|
|
|
15
8
|
permissions:
|
|
16
9
|
contents: "read"
|
|
17
|
-
issues: "write"
|
|
18
10
|
|
|
19
11
|
concurrency:
|
|
20
12
|
group: "${{ github.workflow }}-${{ github.event.issue.number }}"
|
|
@@ -35,6 +27,10 @@ jobs:
|
|
|
35
27
|
check-issues:
|
|
36
28
|
runs-on: "ubuntu-latest"
|
|
37
29
|
timeout-minutes: 5
|
|
30
|
+
permissions:
|
|
31
|
+
contents: "read"
|
|
32
|
+
issues: "write"
|
|
33
|
+
[__JOBS_CONDITION__]
|
|
38
34
|
steps:
|
|
39
35
|
- name: "Checkout repository"
|
|
40
36
|
uses: "actions/checkout@v6"
|
package/build/templates/generators/github/workflows/lock-inactive-issues/triggers/schedule-daily.yml
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
run-name: "Locking inactive issues[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
|
+
publish-condition: "${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
|
+
trigger:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: "0 0 * * *"
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
run-name: "Locking inactive issues[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
|
+
publish-condition: "${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
|
+
trigger:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: "0 0 1 * *"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name: "Publish
|
|
1
|
+
name: "Publish[__WORKFLOW_ID__]"
|
|
2
2
|
|
|
3
3
|
run-name: "[__RUN_NAME__]"
|
|
4
4
|
|
|
@@ -20,16 +20,15 @@ concurrency:
|
|
|
20
20
|
cancel-in-progress: false
|
|
21
21
|
|
|
22
22
|
env:
|
|
23
|
-
CLOUDFLARE_ACCOUNT_ID: "${{ vars.CLOUDFLARE_ACCOUNT_ID }}"
|
|
24
|
-
CLOUDFLARE_PROJECT_NAME: "${{ vars.CLOUDFLARE_PROJECT_NAME }}"
|
|
25
|
-
DOCUSAURUS_DIR: "${{ vars.DOCUSAURUS_WORKING_DIR }}"
|
|
26
23
|
PUBLISH: "[__PUBLISH_CONDITION__]"
|
|
27
24
|
ROOT_DIR: "${{ vars.ROOT_WORKING_DIR }}"
|
|
28
25
|
|
|
29
26
|
jobs:
|
|
30
|
-
|
|
27
|
+
build:
|
|
31
28
|
runs-on: "ubuntu-latest"
|
|
32
|
-
timeout-minutes:
|
|
29
|
+
timeout-minutes: 15
|
|
30
|
+
permissions:
|
|
31
|
+
contents: "read"
|
|
33
32
|
[__JOBS_CONDITION__]
|
|
34
33
|
steps:
|
|
35
34
|
- name: "Checkout repository"
|
|
@@ -49,20 +48,12 @@ jobs:
|
|
|
49
48
|
|
|
50
49
|
- name: "Check project"
|
|
51
50
|
run: |
|
|
52
|
-
|
|
51
|
+
[__CHECK_COMMAND__]
|
|
53
52
|
working-directory: "${{ env.ROOT_DIR }}"
|
|
54
53
|
|
|
55
54
|
- name: "Build project"
|
|
56
55
|
run: |
|
|
57
|
-
|
|
56
|
+
[__BUILD_COMMAND__]
|
|
58
57
|
working-directory: "${{ env.ROOT_DIR }}"
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
if: "${{ env.PUBLISH == 'true' }}"
|
|
62
|
-
uses: "cloudflare/wrangler-action@v3"
|
|
63
|
-
env:
|
|
64
|
-
CLOUDFLARE_API_TOKEN: "${{ secrets.CLOUDFLARE_API_TOKEN }}"
|
|
65
|
-
with:
|
|
66
|
-
apiToken: "${{ env.CLOUDFLARE_API_TOKEN }}"
|
|
67
|
-
accountId: "${{ env.CLOUDFLARE_ACCOUNT_ID }}"
|
|
68
|
-
command: "pages deploy ${{ env.DOCUSAURUS_DIR }}/build --project-name=${{ env.CLOUDFLARE_PROJECT_NAME }} --branch=${{ github.event.repository.default_branch }}"
|
|
59
|
+
[__UPLOAD_ARTIFACT_STEP__]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
publish-aws-amplify-nextjs-[__TARGET_ID__]:
|
|
2
|
+
needs: [__NEEDS__]
|
|
3
|
+
runs-on: "ubuntu-latest"
|
|
4
|
+
timeout-minutes: 15
|
|
5
|
+
permissions:
|
|
6
|
+
contents: "read"
|
|
7
|
+
[__JOBS_CONDITION__]
|
|
8
|
+
steps:
|
|
9
|
+
- name: "Checkout repository"
|
|
10
|
+
uses: "actions/checkout@v6"
|
|
11
|
+
|
|
12
|
+
- name: "Download build artifacts"
|
|
13
|
+
uses: "actions/download-artifact@v4"
|
|
14
|
+
with:
|
|
15
|
+
name: "build-output"
|
|
16
|
+
|
|
17
|
+
- name: "Configure AWS credentials"
|
|
18
|
+
if: "${{ env.PUBLISH == 'true' }}"
|
|
19
|
+
uses: "aws-actions/configure-aws-credentials@v4"
|
|
20
|
+
with:
|
|
21
|
+
aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}"
|
|
22
|
+
aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
|
|
23
|
+
aws-region: "${{ vars.AWS_REGION }}"
|
|
24
|
+
|
|
25
|
+
- name: "Trigger Amplify deployment"
|
|
26
|
+
if: "${{ env.PUBLISH == 'true' }}"
|
|
27
|
+
run: |
|
|
28
|
+
aws amplify start-job \
|
|
29
|
+
--app-id "${{ vars.AMPLIFY_APP_ID }}" \
|
|
30
|
+
--branch-name "${{ vars.AMPLIFY_BRANCH_NAME }}" \
|
|
31
|
+
--job-type RELEASE
|
|
32
|
+
working-directory: "[__WORKING_DIR__]"
|
package/build/templates/generators/github/workflows/publish/targets/cloudflare-pages-docusaurus.yml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
publish-cloudflare-pages-docusaurus-[__TARGET_ID__]:
|
|
2
|
+
needs: [__NEEDS__]
|
|
3
|
+
runs-on: "ubuntu-latest"
|
|
4
|
+
timeout-minutes: 10
|
|
5
|
+
permissions:
|
|
6
|
+
contents: "read"
|
|
7
|
+
[__JOBS_CONDITION__]
|
|
8
|
+
steps:
|
|
9
|
+
- name: "Checkout repository"
|
|
10
|
+
uses: "actions/checkout@v6"
|
|
11
|
+
|
|
12
|
+
- name: "Download build artifacts"
|
|
13
|
+
uses: "actions/download-artifact@v4"
|
|
14
|
+
with:
|
|
15
|
+
name: "build-output"
|
|
16
|
+
|
|
17
|
+
- name: "Deploy to Cloudflare Pages"
|
|
18
|
+
if: "${{ env.PUBLISH == 'true' }}"
|
|
19
|
+
uses: "cloudflare/wrangler-action@v3"
|
|
20
|
+
env:
|
|
21
|
+
CLOUDFLARE_API_TOKEN: "${{ secrets.CLOUDFLARE_API_TOKEN }}"
|
|
22
|
+
with:
|
|
23
|
+
apiToken: "${{ env.CLOUDFLARE_API_TOKEN }}"
|
|
24
|
+
accountId: "${{ vars.CLOUDFLARE_ACCOUNT_ID }}"
|
|
25
|
+
command: "pages deploy [__WORKING_DIR__]/build --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch=${{ github.event.repository.default_branch }}"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
publish-docker-hub-[__TARGET_ID__]:
|
|
2
|
+
needs: [__NEEDS__]
|
|
3
|
+
runs-on: "ubuntu-latest"
|
|
4
|
+
timeout-minutes: 15
|
|
5
|
+
permissions:
|
|
6
|
+
contents: "read"
|
|
7
|
+
attestations: "write"
|
|
8
|
+
id-token: "write"
|
|
9
|
+
[__JOBS_CONDITION__]
|
|
10
|
+
steps:
|
|
11
|
+
- name: "Checkout repository"
|
|
12
|
+
uses: "actions/checkout@v6"
|
|
13
|
+
|
|
14
|
+
- name: "Set up QEMU"
|
|
15
|
+
uses: "docker/setup-qemu-action@v3"
|
|
16
|
+
with:
|
|
17
|
+
platforms: "linux/amd64,linux/arm64"
|
|
18
|
+
|
|
19
|
+
- name: "Set up Docker Buildx"
|
|
20
|
+
uses: "docker/setup-buildx-action@v3"
|
|
21
|
+
|
|
22
|
+
- name: "Login to Docker Hub"
|
|
23
|
+
uses: "docker/login-action@v3"
|
|
24
|
+
env:
|
|
25
|
+
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
|
|
26
|
+
with:
|
|
27
|
+
username: "${{ vars.DOCKERHUB_USERNAME }}"
|
|
28
|
+
password: "${{ env.DOCKERHUB_TOKEN }}"
|
|
29
|
+
|
|
30
|
+
- name: "Build and push"
|
|
31
|
+
id: "build-push"
|
|
32
|
+
uses: "docker/build-push-action@v6"
|
|
33
|
+
with:
|
|
34
|
+
context: "[__WORKING_DIR__]"
|
|
35
|
+
platforms: "linux/amd64,linux/arm64"
|
|
36
|
+
push: "${{ env.PUBLISH }}"
|
|
37
|
+
tags: |
|
|
38
|
+
${{ github.repository }}:latest
|
|
39
|
+
${{ github.repository }}:${{ github.event.release.tag_name || 'manual' }}
|
|
40
|
+
|
|
41
|
+
- name: "Generate build provenance"
|
|
42
|
+
if: "${{ env.PUBLISH == 'true' }}"
|
|
43
|
+
uses: "actions/attest-build-provenance@v2"
|
|
44
|
+
with:
|
|
45
|
+
subject-name: "docker.io/${{ github.repository }}"
|
|
46
|
+
subject-digest: "${{ steps.build-push.outputs.digest }}"
|
|
47
|
+
push-to-registry: true
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
publish-ghcr-[__TARGET_ID__]:
|
|
2
|
+
needs: [__NEEDS__]
|
|
3
|
+
runs-on: "ubuntu-latest"
|
|
4
|
+
timeout-minutes: 15
|
|
5
|
+
permissions:
|
|
6
|
+
contents: "read"
|
|
7
|
+
packages: "write"
|
|
8
|
+
attestations: "write"
|
|
9
|
+
id-token: "write"
|
|
10
|
+
[__JOBS_CONDITION__]
|
|
11
|
+
steps:
|
|
12
|
+
- name: "Checkout repository"
|
|
13
|
+
uses: "actions/checkout@v6"
|
|
14
|
+
|
|
15
|
+
- name: "Set up QEMU"
|
|
16
|
+
uses: "docker/setup-qemu-action@v3"
|
|
17
|
+
with:
|
|
18
|
+
platforms: "linux/amd64,linux/arm64"
|
|
19
|
+
|
|
20
|
+
- name: "Set up Docker Buildx"
|
|
21
|
+
uses: "docker/setup-buildx-action@v3"
|
|
22
|
+
|
|
23
|
+
- name: "Login to GitHub Container Registry"
|
|
24
|
+
uses: "docker/login-action@v3"
|
|
25
|
+
with:
|
|
26
|
+
registry: "ghcr.io"
|
|
27
|
+
username: "${{ github.repository_owner }}"
|
|
28
|
+
password: "${{ secrets.GITHUB_TOKEN }}"
|
|
29
|
+
|
|
30
|
+
- name: "Build and push"
|
|
31
|
+
id: "build-push"
|
|
32
|
+
uses: "docker/build-push-action@v6"
|
|
33
|
+
with:
|
|
34
|
+
context: "[__WORKING_DIR__]"
|
|
35
|
+
platforms: "linux/amd64,linux/arm64"
|
|
36
|
+
push: "${{ env.PUBLISH }}"
|
|
37
|
+
tags: |
|
|
38
|
+
ghcr.io/${{ github.repository }}:latest
|
|
39
|
+
ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name || 'manual' }}
|
|
40
|
+
|
|
41
|
+
- name: "Generate build provenance"
|
|
42
|
+
if: "${{ env.PUBLISH == 'true' }}"
|
|
43
|
+
uses: "actions/attest-build-provenance@v2"
|
|
44
|
+
with:
|
|
45
|
+
subject-name: "ghcr.io/${{ github.repository }}"
|
|
46
|
+
subject-digest: "${{ steps.build-push.outputs.digest }}"
|
|
47
|
+
push-to-registry: true
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
publish-github-packages-[__TARGET_ID__]:
|
|
2
|
+
needs: [__NEEDS__]
|
|
3
|
+
runs-on: "ubuntu-latest"
|
|
4
|
+
timeout-minutes: 10
|
|
5
|
+
permissions:
|
|
6
|
+
contents: "read"
|
|
7
|
+
packages: "write"
|
|
8
|
+
id-token: "write"
|
|
9
|
+
[__JOBS_CONDITION__]
|
|
10
|
+
steps:
|
|
11
|
+
- name: "Checkout repository"
|
|
12
|
+
uses: "actions/checkout@v6"
|
|
13
|
+
|
|
14
|
+
- name: "Setup Node.js"
|
|
15
|
+
uses: "actions/setup-node@v6"
|
|
16
|
+
with:
|
|
17
|
+
node-version-file: "${{ env.ROOT_DIR }}/package.json"
|
|
18
|
+
package-manager-cache: false
|
|
19
|
+
|
|
20
|
+
- name: "Configure registry for GitHub Packages"
|
|
21
|
+
uses: "actions/setup-node@v6"
|
|
22
|
+
with:
|
|
23
|
+
node-version-file: "${{ env.ROOT_DIR }}/package.json"
|
|
24
|
+
package-manager-cache: false
|
|
25
|
+
registry-url: "https://npm.pkg.github.com"
|
|
26
|
+
scope: "@${{ github.repository_owner }}"
|
|
27
|
+
|
|
28
|
+
- name: "Remove deprecated .npmrc entries"
|
|
29
|
+
run: |
|
|
30
|
+
npmrc="${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}"
|
|
31
|
+
|
|
32
|
+
if [ -f "$npmrc" ]; then
|
|
33
|
+
sed -i '/^always-auth=/d' "$npmrc"
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
- name: "Download build artifacts"
|
|
37
|
+
uses: "actions/download-artifact@v4"
|
|
38
|
+
with:
|
|
39
|
+
name: "build-output"
|
|
40
|
+
|
|
41
|
+
- name: "Change to scoped package name"
|
|
42
|
+
run: |
|
|
43
|
+
REPOSITORY_OWNER="@$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')"
|
|
44
|
+
PACKAGE_NAME=$(npm pkg get name --workspaces=false | jq -r '.')
|
|
45
|
+
|
|
46
|
+
echo "[Scope] Owner is \"${REPOSITORY_OWNER}\" and package is \"${PACKAGE_NAME}\"."
|
|
47
|
+
|
|
48
|
+
echo "PACKAGE_NAME=$PACKAGE_NAME" >> "$GITHUB_ENV"
|
|
49
|
+
|
|
50
|
+
if [[ "$PACKAGE_NAME" != "$REPOSITORY_OWNER/"* ]]; then
|
|
51
|
+
BASE=${PACKAGE_NAME##*/}
|
|
52
|
+
NEW_NAME="$REPOSITORY_OWNER/$BASE"
|
|
53
|
+
|
|
54
|
+
echo "[Scope] Scoping package name to \"${NEW_NAME}\"."
|
|
55
|
+
|
|
56
|
+
npm pkg set name="$NEW_NAME"
|
|
57
|
+
else
|
|
58
|
+
echo "[Scope] Already scoped. No changes needed."
|
|
59
|
+
fi
|
|
60
|
+
working-directory: "[__WORKING_DIR__]"
|
|
61
|
+
|
|
62
|
+
- name: "Configure authentication"
|
|
63
|
+
env:
|
|
64
|
+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
65
|
+
run: |
|
|
66
|
+
echo "[Auth] Using GITHUB_TOKEN."
|
|
67
|
+
echo "NODE_AUTH_TOKEN=${GITHUB_TOKEN}" >> "$GITHUB_ENV"
|
|
68
|
+
|
|
69
|
+
- name: "Publish package to GitHub Packages"
|
|
70
|
+
run: |
|
|
71
|
+
if [ "${PUBLISH}" = "true" ]; then
|
|
72
|
+
echo "[Publish] Production."
|
|
73
|
+
npm publish --provenance
|
|
74
|
+
else
|
|
75
|
+
echo "[Publish] Dry run."
|
|
76
|
+
npm publish --dry-run
|
|
77
|
+
fi
|
|
78
|
+
working-directory: "[__WORKING_DIR__]"
|
|
79
|
+
|
|
80
|
+
- name: "Restore package name"
|
|
81
|
+
if: "${{ always() && env.PACKAGE_NAME }}"
|
|
82
|
+
run: |
|
|
83
|
+
npm pkg set name="$PACKAGE_NAME"
|
|
84
|
+
working-directory: "[__WORKING_DIR__]"
|
package/build/templates/generators/github/workflows/publish/targets/github-pages-docusaurus.yml
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
publish-github-pages-docusaurus-[__TARGET_ID__]:
|
|
2
|
+
needs: [__NEEDS__]
|
|
3
|
+
runs-on: "ubuntu-latest"
|
|
4
|
+
timeout-minutes: 10
|
|
5
|
+
permissions:
|
|
6
|
+
contents: "read"
|
|
7
|
+
pages: "write"
|
|
8
|
+
id-token: "write"
|
|
9
|
+
[__JOBS_CONDITION__]
|
|
10
|
+
steps:
|
|
11
|
+
- name: "Checkout repository"
|
|
12
|
+
uses: "actions/checkout@v6"
|
|
13
|
+
|
|
14
|
+
- name: "Download build artifacts"
|
|
15
|
+
uses: "actions/download-artifact@v4"
|
|
16
|
+
with:
|
|
17
|
+
name: "build-output"
|
|
18
|
+
|
|
19
|
+
- name: "Check GitHub Pages status"
|
|
20
|
+
run: |
|
|
21
|
+
if gh api "repos/${{ github.repository }}/pages" > /dev/null 2>&1; then
|
|
22
|
+
echo "[Pages] GitHub Pages is enabled."
|
|
23
|
+
echo "PAGES_ENABLED=true" >> "$GITHUB_ENV"
|
|
24
|
+
else
|
|
25
|
+
echo "[Pages] GitHub Pages is not enabled. Skipping deployment."
|
|
26
|
+
echo "PAGES_ENABLED=false" >> "$GITHUB_ENV"
|
|
27
|
+
fi
|
|
28
|
+
env:
|
|
29
|
+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
30
|
+
|
|
31
|
+
- name: "Setup GitHub Pages"
|
|
32
|
+
if: "${{ env.PUBLISH == 'true' && env.PAGES_ENABLED == 'true' }}"
|
|
33
|
+
uses: "actions/configure-pages@v5"
|
|
34
|
+
|
|
35
|
+
- name: "Upload artifact to GitHub Pages"
|
|
36
|
+
if: "${{ env.PUBLISH == 'true' && env.PAGES_ENABLED == 'true' }}"
|
|
37
|
+
uses: "actions/upload-pages-artifact@v4"
|
|
38
|
+
with:
|
|
39
|
+
path: "[__WORKING_DIR__]/build"
|
|
40
|
+
|
|
41
|
+
- name: "Deploy to GitHub Pages"
|
|
42
|
+
if: "${{ env.PUBLISH == 'true' && env.PAGES_ENABLED == 'true' }}"
|
|
43
|
+
uses: "actions/deploy-pages@v4"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
publish-npm-[__TARGET_ID__]:
|
|
2
|
+
needs: [__NEEDS__]
|
|
3
|
+
runs-on: "ubuntu-latest"
|
|
4
|
+
timeout-minutes: 10
|
|
5
|
+
permissions:
|
|
6
|
+
contents: "read"
|
|
7
|
+
id-token: "write"
|
|
8
|
+
[__JOBS_CONDITION__]
|
|
9
|
+
steps:
|
|
10
|
+
- name: "Checkout repository"
|
|
11
|
+
uses: "actions/checkout@v6"
|
|
12
|
+
|
|
13
|
+
- name: "Setup Node.js"
|
|
14
|
+
uses: "actions/setup-node@v6"
|
|
15
|
+
with:
|
|
16
|
+
node-version-file: "${{ env.ROOT_DIR }}/package.json"
|
|
17
|
+
package-manager-cache: false
|
|
18
|
+
registry-url: "https://registry.npmjs.org"
|
|
19
|
+
|
|
20
|
+
- name: "Remove deprecated .npmrc entries"
|
|
21
|
+
run: |
|
|
22
|
+
npmrc="${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}"
|
|
23
|
+
|
|
24
|
+
if [ -f "$npmrc" ]; then
|
|
25
|
+
sed -i '/^always-auth=/d' "$npmrc"
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
- name: "Download build artifacts"
|
|
29
|
+
uses: "actions/download-artifact@v4"
|
|
30
|
+
with:
|
|
31
|
+
name: "build-output"
|
|
32
|
+
|
|
33
|
+
- name: "Configure authentication"
|
|
34
|
+
env:
|
|
35
|
+
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
|
|
36
|
+
run: |
|
|
37
|
+
if [ -n "${NPM_TOKEN}" ]; then
|
|
38
|
+
echo "[Auth] Using NPM_TOKEN (token-based)."
|
|
39
|
+
echo "NODE_AUTH_TOKEN=${NPM_TOKEN}" >> "$GITHUB_ENV"
|
|
40
|
+
else
|
|
41
|
+
echo "[Auth] Using trusted publishing (OIDC)."
|
|
42
|
+
|
|
43
|
+
npmrc="${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}"
|
|
44
|
+
|
|
45
|
+
if [ -f "$npmrc" ]; then
|
|
46
|
+
sed -i '/^\/\/registry\.npmjs\.org\/:_authToken/d' "$npmrc"
|
|
47
|
+
echo "[Auth] Removed _authToken entry from .npmrc."
|
|
48
|
+
fi
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
- name: "Publish package to npm"
|
|
52
|
+
run: |
|
|
53
|
+
if [ "${PUBLISH}" = "true" ]; then
|
|
54
|
+
echo "[Publish] Production."
|
|
55
|
+
npm publish --provenance
|
|
56
|
+
else
|
|
57
|
+
echo "[Publish] Dry run."
|
|
58
|
+
npm publish --dry-run
|
|
59
|
+
fi
|
|
60
|
+
working-directory: "[__WORKING_DIR__]"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
publish-vercel-nextjs-[__TARGET_ID__]:
|
|
2
|
+
needs: [__NEEDS__]
|
|
3
|
+
runs-on: "ubuntu-latest"
|
|
4
|
+
timeout-minutes: 15
|
|
5
|
+
permissions:
|
|
6
|
+
contents: "read"
|
|
7
|
+
[__JOBS_CONDITION__]
|
|
8
|
+
steps:
|
|
9
|
+
- name: "Checkout repository"
|
|
10
|
+
uses: "actions/checkout@v6"
|
|
11
|
+
|
|
12
|
+
- name: "Setup Node.js"
|
|
13
|
+
uses: "actions/setup-node@v6"
|
|
14
|
+
with:
|
|
15
|
+
node-version-file: "${{ env.ROOT_DIR }}/package.json"
|
|
16
|
+
package-manager-cache: false
|
|
17
|
+
|
|
18
|
+
- name: "Download build artifacts"
|
|
19
|
+
uses: "actions/download-artifact@v4"
|
|
20
|
+
with:
|
|
21
|
+
name: "build-output"
|
|
22
|
+
|
|
23
|
+
- name: "Install Vercel CLI"
|
|
24
|
+
if: "${{ env.PUBLISH == 'true' }}"
|
|
25
|
+
run: npm install -g vercel@latest
|
|
26
|
+
|
|
27
|
+
- name: "Pull Vercel environment"
|
|
28
|
+
if: "${{ env.PUBLISH == 'true' }}"
|
|
29
|
+
env:
|
|
30
|
+
VERCEL_TOKEN: "${{ secrets.VERCEL_TOKEN }}"
|
|
31
|
+
VERCEL_ORG_ID: "${{ vars.VERCEL_ORG_ID }}"
|
|
32
|
+
VERCEL_PROJECT_ID: "${{ vars.VERCEL_PROJECT_ID }}"
|
|
33
|
+
run: |
|
|
34
|
+
vercel pull --yes --environment=production --token="${VERCEL_TOKEN}"
|
|
35
|
+
working-directory: "[__WORKING_DIR__]"
|
|
36
|
+
|
|
37
|
+
- name: "Deploy to Vercel"
|
|
38
|
+
if: "${{ env.PUBLISH == 'true' }}"
|
|
39
|
+
env:
|
|
40
|
+
VERCEL_TOKEN: "${{ secrets.VERCEL_TOKEN }}"
|
|
41
|
+
VERCEL_ORG_ID: "${{ vars.VERCEL_ORG_ID }}"
|
|
42
|
+
VERCEL_PROJECT_ID: "${{ vars.VERCEL_PROJECT_ID }}"
|
|
43
|
+
run: |
|
|
44
|
+
vercel deploy --prebuilt --prod --token="${VERCEL_TOKEN}"
|
|
45
|
+
working-directory: "[__WORKING_DIR__]"
|
package/build/templates/generators/github/workflows/{publish-to-npm → publish}/triggers/release.yml
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
run-name: "Publishing ${{ github.event.release.tag_name || 'manually' }}
|
|
1
|
+
run-name: "Publishing ${{ github.event.release.tag_name || 'manually' }}[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
2
|
publish-condition: "${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
3
|
trigger:
|
|
4
4
|
release:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }}
|
|
1
|
+
run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }}[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
2
|
publish-condition: "${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
3
|
depends-on: true
|
|
4
4
|
trigger:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }}
|
|
1
|
+
run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }}[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
2
|
publish-condition: "${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
3
|
depends-on: true
|
|
4
4
|
trigger:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }}
|
|
1
|
+
run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }}[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
2
|
publish-condition: "${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
3
|
depends-on: true
|
|
4
4
|
trigger:
|
package/package.json
CHANGED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
name: "Publish to AWS Amplify / Next.js[__WORKFLOW_ID__]"
|
|
2
|
-
|
|
3
|
-
run-name: "[__RUN_NAME__]"
|
|
4
|
-
|
|
5
|
-
on:
|
|
6
|
-
[__TRIGGERS__]
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
inputs:
|
|
9
|
-
dry-run:
|
|
10
|
-
description: "Run without making changes"
|
|
11
|
-
required: false
|
|
12
|
-
type: "boolean"
|
|
13
|
-
default: true
|
|
14
|
-
|
|
15
|
-
permissions:
|
|
16
|
-
contents: "read"
|
|
17
|
-
|
|
18
|
-
concurrency:
|
|
19
|
-
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
20
|
-
cancel-in-progress: false
|
|
21
|
-
|
|
22
|
-
env:
|
|
23
|
-
AWS_REGION: "${{ vars.AWS_REGION }}"
|
|
24
|
-
AMPLIFY_APP_ID: "${{ vars.AMPLIFY_APP_ID }}"
|
|
25
|
-
AMPLIFY_BRANCH_NAME: "${{ vars.AMPLIFY_BRANCH_NAME }}"
|
|
26
|
-
PUBLISH: "[__PUBLISH_CONDITION__]"
|
|
27
|
-
|
|
28
|
-
jobs:
|
|
29
|
-
publish-to-aws-amplify:
|
|
30
|
-
runs-on: "ubuntu-latest"
|
|
31
|
-
timeout-minutes: 10
|
|
32
|
-
[__JOBS_CONDITION__]
|
|
33
|
-
steps:
|
|
34
|
-
- name: "Configure AWS credentials"
|
|
35
|
-
uses: "aws-actions/configure-aws-credentials@v4"
|
|
36
|
-
env:
|
|
37
|
-
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
|
|
38
|
-
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
|
|
39
|
-
with:
|
|
40
|
-
aws-access-key-id: "${{ env.AWS_ACCESS_KEY_ID }}"
|
|
41
|
-
aws-secret-access-key: "${{ env.AWS_SECRET_ACCESS_KEY }}"
|
|
42
|
-
aws-region: "${{ env.AWS_REGION }}"
|
|
43
|
-
|
|
44
|
-
- name: "Trigger Amplify build"
|
|
45
|
-
run: |
|
|
46
|
-
if [ "${PUBLISH}" = "true" ]; then
|
|
47
|
-
echo "[Publish] Production."
|
|
48
|
-
aws amplify start-job \
|
|
49
|
-
--app-id "${AMPLIFY_APP_ID}" \
|
|
50
|
-
--branch-name "${AMPLIFY_BRANCH_NAME}" \
|
|
51
|
-
--job-type RELEASE
|
|
52
|
-
else
|
|
53
|
-
echo "[Publish] Dry run."
|
|
54
|
-
fi
|
package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/triggers/push.yml
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
run-name: "Publishing ${{ github.ref_name || 'manually' }} to AWS Amplify / Next.js[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
|
-
publish-condition: "${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
|
-
trigger:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ "main" ]
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
run-name: "Publishing ${{ github.event.release.tag_name || 'manually' }} to AWS Amplify / Next.js[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
|
-
publish-condition: "${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
|
-
trigger:
|
|
4
|
-
release:
|
|
5
|
-
types: [ "published" ]
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
run-name: "Publishing ${{ github.ref_name || 'manually' }} to Cloudflare Pages / Docusaurus[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
|
-
publish-condition: "${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
|
-
trigger:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ "main" ]
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
run-name: "Publishing ${{ github.event.release.tag_name || 'manually' }} to Cloudflare Pages / Docusaurus[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
|
|
2
|
-
publish-condition: "${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
|
|
3
|
-
trigger:
|
|
4
|
-
release:
|
|
5
|
-
types: [ "published" ]
|