chore: setup ci workflow
Some checks failed
Publish package / build_and_publish (push) Failing after 19s

update workflows

update workflows

update workflows

update workflows

update config

add cog config
This commit is contained in:
Alexander Navarro 2024-10-23 12:55:26 -03:00
parent cf0b4011d1
commit 1b7f92a120
Signed by untrusted user who does not match committer: anavarro
GPG key ID: 6426043E9FA3E3B5
8 changed files with 114 additions and 10 deletions

View file

@ -0,0 +1,48 @@
name: Publish package
on:
push:
workflow_dispatch:
env:
NPM_TAG: ${{ github.ref == 'refs/heads/main' && 'latest' || 'next' }}
# Variables reference: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#about-contexts
# Syntax reference: https://forgejo.org/docs/latest/user/actions/
jobs:
build_and_publish:
runs-on: docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Bun dependencies
id: cache
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Setup Bun
id: "setup_bun"
uses: oven-sh/setup-bun@v2
- name: Setup Cog
uses: https://github.com/oknozor/cocogitto-action@v3
with:
release: false
git-user: 'Cog Bot'
git-user-email: 'cog@alecodes.page'
- name: Create release
env:
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_TOKEN_FORGEJO }}
run: "cog bump --auto --hook-profile ${{ env.NPM_TAG }}"
- name: Summary
run: |
echo "Bun executable chache found:\t${{ steps.setup_bun.outputs.cache-hit }}";
echo "Bun dependencies chache found:\t${{ steps.cache.outputs.cache-hit }}";
echo "Package published:\t${{ steps.publish.outcome }}";

BIN
bun.lockb

Binary file not shown.

4
bunfig.toml Normal file
View file

@ -0,0 +1,4 @@
[install.scopes]
"@alecodes" = { token = "$NPM_REGISTRY_TOKEN", url = "https://git.alecodes.page/api/packages/alecodes/npm/" }
"@mini-strap" = { token = "$NPM_REGISTRY_TOKEN", url = "https://git.alecodes.page/api/packages/alecodes/npm/" }

39
cog.toml Normal file
View file

@ -0,0 +1,39 @@
from_latest_tag = true
ignore_merge_commits = false
disable_changelog = false
disable_bump_commit = false
tag_prefix = "v"
generate_mono_repository_global_tag = true
branch_whitelist = []
skip_ci = "[skip ci]"
skip_untracked = false
pre_bump_hooks = []
post_bump_hooks = []
pre_package_bump_hooks = [
"echo 'bump package {{package}} to {{version}}'",
"sed -E -i 's/(\"version\":) \"[0-9.]{5}\"/\\1 \"{{version}}\"/gi' package.json",
]
post_package_bump_hooks = []
[git_hooks]
[commit_types]
[changelog]
path = "CHANGELOG.md"
authors = []
[bump_profiles.latest]
pre_package_bump_hooks = [
"bun run ci:publish --tag latest",
]
[bump_profiles.next]
pre_package_bump_hooks = [
"bun run ci:publish --tag next",
]
[packages]
"@mini-strap/core" = { path = "packages/core" }
"@mini-strap/components" = { path = "packages/components" }
"@mini-strap/website" = { path = "packages/website", public_api = false }

View file

@ -1,6 +1,8 @@
{
"name": "mini-strap",
"name": "@alecodes/mini-strap",
"version": "0.0.1",
"module": "index.ts",
"private": true,
"devDependencies": {
"@eslint/js": "^9.10.0",
"@types/bun": "latest",
@ -14,8 +16,12 @@
"typescript": "^5.0.0"
},
"scripts": {
"dev": "bun --filter '*' dev"
"dev": "bun --filter '*' dev",
"ci:publish": "bun --filter '**/core' ci:publish",
"bump": "cog bump --auto --skip-untracked"
},
"type": "module",
"workspaces": ["packages/*"]
"workspaces": [
"packages/*"
]
}

View file

@ -1,7 +1,11 @@
{
"name": "mini-strap-components",
"name": "@mini-strap/components",
"version": "0.0.1",
"module": "src/components.scss",
"type": "module",
"scripts": {
"ci:publish": "bun publish --production --frozen-lockfile"
},
"devDependencies": {
"@types/bun": "latest"
},
@ -9,4 +13,3 @@
"typescript": "^5.0.0"
}
}

View file

@ -1,7 +1,11 @@
{
"name": "mini-strap-core",
"name": "@mini-strap/core",
"version": "0.0.1",
"module": "src/style.scss",
"type": "module",
"scripts": {
"ci:publish": "bun publish --production --frozen-lockfile --silent"
},
"devDependencies": {
"@types/bun": "latest"
},
@ -9,4 +13,3 @@
"typescript": "^5.0.0"
}
}

View file

@ -1,12 +1,13 @@
{
"name": "mini-strap-website",
"name": "@mini-strap/website",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite --port 3000",
"build": "tsc && vite build",
"preview": "vite preview"
"preview": "vite preview",
"ci:publish": "echo 'no publish workflow defined to this package...'"
},
"devDependencies": {
"sass-embedded": "^1.78.0",