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
Binary file modified .env.ci
Binary file not shown.
42 changes: 5 additions & 37 deletions .github/composite/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Export GitHub Token
shell: bash
run: echo "GH_TOKEN=${{ inputs.GITHUB_TOKEN }}" >> $GITHUB_ENV

- name: Disable man-db
shell: bash
run: sudo bash -ec 'echo "set man-db/auto-update false" | debconf-communicate; dpkg-reconfigure man-db'

- uses: oven-sh/setup-bun@v2
- name: Setup
uses: tahminator/pipeline/actions/setup@1.0.17
with:
bun-version: latest

- name: Cache Bun dependencies
uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('.github/scripts/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-

- name: Install deps
shell: bash
run: bun install --cwd .github/scripts --frozen-lockfile

- name: Test CI scripts
shell: bash
run: bun run --cwd .github/scripts test

- name: Load GPG secret key
uses: crazy-max/ghaction-import-gpg@v6
if: inputs.GPG_PRIVATE_KEY != '' && inputs.GPG_PASSPHRASE != ''
with:
gpg_private_key: ${{ inputs.GPG_PRIVATE_KEY }}
passphrase: ${{ inputs.GPG_PASSPHRASE }}

- name: Install git-crypt
if: inputs.GPG_PRIVATE_KEY != '' && inputs.GPG_PASSPHRASE != ''
uses: flydiverny/setup-git-crypt@v4
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }}
GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }}
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/scripts/bun.lock

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

2 changes: 1 addition & 1 deletion .github/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"license": "MIT",
"dependencies": {
"@octokit/rest": "^22.0.1",
"@tahminator/pipeline": "^1.0.9",
"@tahminator/pipeline": "^1.0.16",
"@types/yargs": "^17.0.35",
"bun": "^1.3.6",
"octokit": "^5.0.5",
Expand Down
16 changes: 1 addition & 15 deletions .github/scripts/src/upload-npm/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
import { NPMClient } from "@tahminator/pipeline";
import { Utils } from "@tahminator/pipeline";

async function main() {
const { npmToken } = parseCiEnv(await Utils.getEnvVariables(["ci"]));
await using npmClient = await NPMClient.create(npmToken);
await using npmClient = await NPMClient.create();

await npmClient.publish();
}

function parseCiEnv(ciEnv: Record<string, string>) {
const npmToken = (() => {
const v = ciEnv["NPM_TOKEN"];
if (!v) {
throw new Error("Missing NPM_TOKEN from .env.ci");
}
return v;
})();

return { npmToken };
}

main()
.then(() => {
process.exit(0);
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ run-name: Running continuous deployment on ${{ github.actor }}'s commits

permissions:
contents: read
id-token: write

on:
push:
Expand Down Expand Up @@ -31,7 +32,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "24" # to be used for npm publish via OIDC
cache: "pnpm"

- name: Install Dependencies
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"name": "@tahminator/sapling",
"version": "1.5.0",
"version": "0.0.0",
"author": "Tahmid Ahmed",
"description": "A library to help you write cleaner Express.js code",
"repository": {
"url": "git+https://github.com/tahminator/pipeline.git"
},
"scripts": {
"test": "pnpm run build",
"build": "rm -rf dist && tsc"
Expand All @@ -20,7 +24,6 @@
"/dist"
],
"keywords": [],
"author": "Tahmid Ahmed",
"license": "ISC",
"packageManager": "pnpm@10.12.4",
"dependencies": {
Expand Down
Loading