Skip to content

Commit

Permalink
feat: integrate changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkz committed Nov 22, 2024
1 parent abd6221 commit 8ab34a0
Show file tree
Hide file tree
Showing 5 changed files with 609 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
32 changes: 26 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Releases
name: Release

on:
push:
tags:
- '*'
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Install pnpm
Expand All @@ -20,15 +21,34 @@ jobs:
node-version: 22.x
cache: 'pnpm'
- run: pnpm install
- run: node cli.js

- name: Create Release Pull Request or Tag
id: changesets
uses: changesets/action@v1
with:
publish: pnpm changeset tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build templates
if: steps.changesets.outputs.published == 'true'
run: node cli.js

- name: Install uv
if: steps.changesets.outputs.published == 'true'
uses: astral-sh/setup-uv@v3
with:
version: '0.4.27'
- name: Release
- name: Gen APKG
if: steps.changesets.outputs.published == 'true'
run: uv run --frozen release.py
- uses: ncipollo/[email protected]

- name: Release
if: steps.changesets.outputs.published == 'true'
uses: ncipollo/[email protected]
with:
artifacts: 'release/*.apkg'
artifactErrorsFailBuild: true
tag: ${{format('v{0}', fromJSON(steps.changesets.outputs.publishedPackages)[0].version)}}
allowUpdates: true
omitBodyDuringUpdate: true
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "anki-templates",
"type": "module",
"version": "1.0.8",
"version": "1.0.9",
"private": true,
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -10,6 +11,7 @@
"license": "ISC",
"packageManager": "[email protected]+sha512.8e4c3550fb500e808dbc30bb0ce4dd1eb614e30b1c55245f211591ec2cdf9c611cabd34e1364b42f564bd54b3945ed0f49d61d1bbf2ec9bd74b866fcdc723276",
"devDependencies": {
"@changesets/cli": "^2.27.10",
"@eslint/js": "^9.9.1",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-commonjs": "^26.0.1",
Expand Down
Loading

0 comments on commit 8ab34a0

Please sign in to comment.