Skip to content

Commit 0ffc6c5

Browse files
Merge pull request #196 from runpod-workers/chore/migrate-to-changesets
chore: replace semantic-release with changesets
2 parents 0e2bf22 + 22d58f7 commit 0ffc6c5

11 files changed

Lines changed: 946 additions & 67 deletions

File tree

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
.changeset
3+
.git
4+
.github

.github/CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ Fork the repository and create a new branch (feature/my-feature) Commit changes
1212
"conventional-changelog" rules. Do not modify any versions manually. Don't build new versions. Use
1313
the PULL_REQUEST_TEMPLATE
1414

15+
### Changesets
16+
17+
Before merging a PR that affects the release (bug fixes, new features, breaking changes), run:
18+
19+
```bash
20+
pnpm changeset
21+
```
22+
23+
This will prompt you to select the type of change (patch, minor, or major) and write a summary.
24+
The generated changeset file should be committed along with your PR. When the PR is merged,
25+
changesets will automatically open a versioning PR and handle the release.
26+
1527
## Reporting issues
1628

1729
Ensure any install or build dependencies are removed before the end of the layer when doing a build.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
## Issues closed
66

77
<!-- List closed issues here -->
8+
9+
## Changeset
10+
11+
<!-- If this PR affects the release (bug fix, feature, breaking change), run `pnpm changeset` and commit the generated file. -->

.github/workflows/release.yml

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,59 @@
11
name: release
22

33
on:
4-
workflow_dispatch:
54
push:
65
branches:
76
- "main"
7+
workflow_dispatch:
88

99
jobs:
1010
release:
11-
runs-on: [blacksmith-8vcpu-ubuntu-2204, linux]
12-
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
11+
runs-on: ubuntu-latest
1312
permissions:
1413
contents: write
15-
issues: write
1614
pull-requests: write
1715

16+
outputs:
17+
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
18+
1819
steps:
1920
- name: Checkout
20-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
22+
23+
- name: Setup pnpm
24+
uses: pnpm/action-setup@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
2128
with:
22-
persist-credentials: false
29+
node-version: 20
30+
cache: pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Create release PR or detect version commit
36+
id: changesets
37+
uses: changesets/action@v1
38+
with:
39+
version: pnpm changeset:version
40+
commit: "chore: version packages"
41+
title: "chore: version packages"
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
docker:
46+
needs: release
47+
if: >-
48+
github.event_name == 'workflow_dispatch' ||
49+
(needs.release.outputs.hasChangesets == 'false' && contains(github.event.head_commit.message, 'chore: version packages'))
50+
runs-on: [blacksmith-8vcpu-ubuntu-2204, linux]
51+
permissions:
52+
contents: write
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
2357

2458
- name: Clear space to remove unused folders
2559
run: |
@@ -28,6 +62,10 @@ jobs:
2862
rm -rf "/usr/local/share/boost"
2963
rm -rf "$AGENT_TOOLSDIRECTORY"
3064
65+
- name: Read version from package.json
66+
id: version
67+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
68+
3169
- name: Set up QEMU
3270
uses: docker/setup-qemu-action@v3
3371

@@ -40,41 +78,24 @@ jobs:
4078
username: ${{ secrets.DOCKERHUB_USERNAME }}
4179
password: ${{ secrets.DOCKERHUB_TOKEN }}
4280

43-
- name: Update the ToC in the README.md
44-
run: npx markdown-toc README.md -i
45-
46-
- name: Semantic release
47-
uses: codfish/semantic-release-action@v3
48-
id: semanticrelease
49-
with:
50-
additional-packages: |
51-
['@semantic-release/git', '@semantic-release/changelog', '@semantic-release/exec']
52-
env:
53-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
54-
55-
- name: Set environment variables
56-
if: steps.semanticrelease.outputs.new-release-published == 'true'
57-
run: |
58-
echo "DOCKERHUB_REPO=${{ vars.DOCKERHUB_REPO }}" >> $GITHUB_ENV
59-
echo "DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG }}" >> $GITHUB_ENV
60-
echo "HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" >> $GITHUB_ENV
61-
echo "RELEASE_VERSION=${{ steps.semanticrelease.outputs.release-version }}" >> $GITHUB_ENV
62-
6381
- name: Build and push the images to Docker Hub
64-
if: steps.semanticrelease.outputs.new-release-published == 'true'
6582
uses: docker/bake-action@v2
6683
with:
6784
push: true
6885
set: |
69-
*.args.DOCKERHUB_REPO=${{ env.DOCKERHUB_REPO }}
70-
*.args.DOCKERHUB_IMG=${{ env.DOCKERHUB_IMG }}
71-
*.args.RELEASE_VERSION=${{ env.RELEASE_VERSION }}
72-
*.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }}
86+
*.args.DOCKERHUB_REPO=${{ vars.DOCKERHUB_REPO }}
87+
*.args.DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG }}
88+
*.args.RELEASE_VERSION=${{ steps.version.outputs.version }}
89+
*.args.HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}
7390
7491
- name: Update description on Docker Hub
75-
if: steps.semanticrelease.outputs.new-release-published == 'true'
7692
uses: peter-evans/dockerhub-description@v3
7793
with:
7894
username: ${{ secrets.DOCKERHUB_USERNAME }}
7995
password: ${{ secrets.DOCKERHUB_TOKEN }}
80-
repository: ${{ env.DOCKERHUB_REPO }}/${{ env.DOCKERHUB_IMG }}
96+
repository: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}
97+
98+
- name: Create GitHub release
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
run: gh release create "${{ steps.version.outputs.version }}" --generate-notes

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ venv
44
data
55
models
66
simulated_uploaded
7-
__pycache__
7+
__pycache__
8+
node_modules

.releaserc

Lines changed: 0 additions & 33 deletions
This file was deleted.

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "worker-comfyui",
3+
"version": "5.7.1",
4+
"private": true,
5+
"scripts": {
6+
"changeset": "changeset",
7+
"changeset:version": "changeset version && node scripts/update-readme-version.js"
8+
},
9+
"devDependencies": {
10+
"@changesets/cli": "^2.29.0"
11+
}
12+
}

0 commit comments

Comments
 (0)