Skip to content

Restore IPv6 binding for Railway GeoIP service #399

Restore IPv6 binding for Railway GeoIP service

Restore IPv6 binding for Railway GeoIP service #399

Workflow file for this run

name: Release
on:
push:
branches:
- main
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
if: github.repository_owner == 'cossistantcom'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Check types
run: bun run check-types
- name: Build example integration app
run: bun run build --filter @cossistant/example-nextjs-tailwind
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
version: node .github/changeset-version.js
publish: bun run changeset:publish
title: "chore(release): version packages"
commit: "chore(release): version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
- name: Create GitHub releases
if: steps.changesets.outputs.published == 'true'
uses: actions/github-script@v7
env:
PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
with:
script: |
const packages = JSON.parse(process.env.PACKAGES ?? "[]");
if (!packages.length) {
core.notice("No packages published, skipping release creation.");
return;
}
const { execSync } = require("child_process");
for (const pkg of packages) {
const tag = `${pkg.name}@${pkg.version}`;
let body = "";
try {
body = execSync(`node .github/generate-release-notes.js ${tag}`, {
cwd: process.env.GITHUB_WORKSPACE,
stdio: ["ignore", "pipe", "inherit"],
}).toString();
} catch (error) {
core.warning(`Failed to generate release notes for ${tag}: ${error.message}`);
body = `${tag} published via Changesets.`;
}
try {
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: tag,
name: `${pkg.name} v${pkg.version}`,
body,
draft: false,
prerelease: false,
});
core.info(`Created release for ${tag}`);
} catch (error) {
if (error.status === 422) {
core.warning(`Release for ${tag} already exists. Skipping.`);
} else {
throw error;
}
}
}