Skip to content
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
1 change: 0 additions & 1 deletion .github/scripts/.prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions .github/scripts/.prettierrc

This file was deleted.

341 changes: 133 additions & 208 deletions .github/scripts/bun.lock

Large diffs are not rendered by default.

43 changes: 0 additions & 43 deletions .github/scripts/eslint.config.ts

This file was deleted.

6 changes: 6 additions & 0 deletions .github/scripts/oxfmt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import shared from "@Patina-Network/cicd-config/oxfmt";
import { defineConfig } from "oxfmt";

export default defineConfig({
...shared,
});
6 changes: 6 additions & 0 deletions .github/scripts/oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import shared from "@Patina-Network/cicd-config/oxlint";
import { defineConfig } from "oxlint";

export default defineConfig({
...shared,
});
31 changes: 14 additions & 17 deletions .github/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
{
"name": "scripts",
"version": "1.0.0",
"description": "@patina-network/hello-world-grpc-client-java CI Scripts",
"private": true,
"description": "@patina-network/hello-world-grpc-client-java CI Scripts",
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit",
"test": "bun run typecheck && bun run prettier && bun run lint",
"fix": "bun run eslint:fix && bun run prettier:fix",
"lint": "bun run eslint",
"eslint": "eslint .",
"eslint:fix": "eslint . --fix",
"prettier": "prettier --check .",
"prettier:fix": "prettier --write ."
"test": "bun run typecheck && bun run fmt && bun run lint",
"fix": "bun run lint:fix && bun run fmt:fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"fmt": "oxfmt --check .",
"fmt:fix": "oxfmt --write ."
},
"dependencies": {
"@tahminator/pipeline": "1.0.93",
"@tahminator/pipeline": "^1.0.96",
"yargs": "^18.2.0"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@Patina-Network/cicd-config": "github:Patina-Network/cicd-config#a54b3e5d8b373be5254ce1cec44cfabdec1d5189",
"@types/bun": "^1.4.2",
"@types/yargs": "^17.0.35",
"eslint": "^10.12.0",
"eslint-plugin-perfectionist": "^5.12.1",
"globals": "^17.13.0",
"jiti": "^2.7.0",
"prettier": "^3.9.9",
"typescript": "^5.9.3",
"typescript-eslint": "^8.71.1"
"oxfmt": "^0.72.0",
"oxlint": "^1.87.0",
"oxlint-tsgolint": "^7.0.2003",
"typescript": "7"
}
}
15 changes: 3 additions & 12 deletions .github/scripts/src/build-image/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
DockerClient,
type Environment,
GitHubClient,
} from "@tahminator/pipeline";
import { DockerClient, type Environment, GitHubClient } from "@tahminator/pipeline";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";

Expand Down Expand Up @@ -48,14 +44,9 @@ async function main() {
const image = `${dockerHubUsername}/${repository}`;
const short = shortSha(sha);
const tags =
environment === "staging" ?
[`staging-${short}`, `sha-${sha}`]
: [short, `sha-${sha}`];
environment === "staging" ? [`staging-${short}`, `sha-${sha}`] : [short, `sha-${sha}`];

await using dockerClient = await DockerClient.create(
dockerHubUsername,
dockerHubPat,
);
await using dockerClient = await DockerClient.create(dockerHubUsername, dockerHubPat);

await dockerClient.buildImage({
dockerRepository: repository,
Expand Down
11 changes: 2 additions & 9 deletions .github/scripts/src/create-tag/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
GitHubClient,
VersioningClient,
VersionUpdatingStrategy,
} from "@tahminator/pipeline";
import { GitHubClient, VersioningClient, VersionUpdatingStrategy } from "@tahminator/pipeline";

import { requiredEnv } from "../consts";

Expand All @@ -13,10 +9,7 @@ async function main() {
privateKey: requiredEnv("_GITHUB_APP_PEM_CONTENT"),
});

const versioningClient = new VersioningClient(
ghClient,
VersionUpdatingStrategy.NONE,
);
const versioningClient = new VersioningClient(ghClient, VersionUpdatingStrategy.NONE);

await ghClient.createTag({
nextTag: await versioningClient.next(),
Expand Down
6 changes: 3 additions & 3 deletions .github/scripts/src/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const { environment, releaseTag, sha } = await yargs(hideBin(process.argv))

async function main() {
const version =
environment === "staging" ?
`staging-${shortSha(sha ?? "")}`
: (releaseTag ?? shortSha(sha ?? ""));
environment === "staging"
? `staging-${shortSha(sha ?? "")}`
: (releaseTag ?? shortSha(sha ?? ""));

const ghClient = await GitHubClient.createWithGithubAppToken({
appId: requiredEnv("_GITHUB_APP_APP_ID"),
Expand Down
10 changes: 2 additions & 8 deletions .github/scripts/src/promote-image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import { DockerClient } from "@tahminator/pipeline";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";

import {
ARCHITECTURES,
dockerRepository,
requiredEnv,
shortSha,
} from "../consts";
import { ARCHITECTURES, dockerRepository, requiredEnv, shortSha } from "../consts";

const { releaseTag, sha, arch } = await yargs(hideBin(process.argv))
.option("releaseTag", {
Expand All @@ -22,8 +17,7 @@ const { releaseTag, sha, arch } = await yargs(hideBin(process.argv))
})
.option("arch", {
choices: ARCHITECTURES,
describe:
"Image architecture to promote. Must match the runner's architecture",
describe: "Image architecture to promote. Must match the runner's architecture",
default: "amd64" as const,
})
.strict()
Expand Down
25 changes: 2 additions & 23 deletions .github/scripts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
{
"extends": "@Patina-Network/cicd-config/tsconfig",
"compilerOptions": {
"lib": ["ESNext"],
"target": "ESNext",
"module": "Preserve",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,

"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,

"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false,

"paths": {
"@/*": ["./src/*"]
}
},
"include": ["./src/**/*", "eslint.config.ts"]
"include": ["./src/**/*", "oxfmt.config.ts", "oxlint.config.ts"]
}
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fetch-depth: 2

- name: Setup Pipeline
uses: tahminator/pipeline/actions/setup@8601c1c7d28289879772574a60fe817fb953eeee # 1.0.93
uses: tahminator/pipeline/actions/setup@52eb2a0451daba94989db6a6fa232e689144aa50 # 1.0.96
with:
SECRETS: ${{ toJSON(secrets) }}
LINT_CI: true
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Pipeline
uses: tahminator/pipeline/actions/setup@8601c1c7d28289879772574a60fe817fb953eeee # 1.0.93
uses: tahminator/pipeline/actions/setup@52eb2a0451daba94989db6a6fa232e689144aa50 # 1.0.96
with:
SECRETS: ${{ toJSON(secrets) }}
LINT_CI: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Pipeline
uses: tahminator/pipeline/actions/setup@8601c1c7d28289879772574a60fe817fb953eeee # 1.0.93
uses: tahminator/pipeline/actions/setup@52eb2a0451daba94989db6a6fa232e689144aa50 # 1.0.96
with:
SECRETS: ${{ toJSON(secrets) }}
HEADSCALE_ADDRESS: ${{ secrets.HEADSCALE_ADDRESS }}
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Pipeline
uses: tahminator/pipeline/actions/setup@8601c1c7d28289879772574a60fe817fb953eeee # 1.0.93
uses: tahminator/pipeline/actions/setup@52eb2a0451daba94989db6a6fa232e689144aa50 # 1.0.96
with:
SECRETS: ${{ toJSON(secrets) }}
LINT_CI: true
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Pipeline
uses: tahminator/pipeline/actions/setup@8601c1c7d28289879772574a60fe817fb953eeee # 1.0.93
uses: tahminator/pipeline/actions/setup@52eb2a0451daba94989db6a6fa232e689144aa50 # 1.0.96
with:
SECRETS: ${{ toJSON(secrets) }}
LINT_CI: true
Expand All @@ -126,7 +126,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Pipeline
uses: tahminator/pipeline/actions/setup@8601c1c7d28289879772574a60fe817fb953eeee # 1.0.93
uses: tahminator/pipeline/actions/setup@52eb2a0451daba94989db6a6fa232e689144aa50 # 1.0.96
with:
SECRETS: ${{ toJSON(secrets) }}
LINT_CI: true
Expand Down
Loading