Skip to content

Commit e2cd33a

Browse files
committed
revert release.yml
1 parent 2083760 commit e2cd33a

File tree

1 file changed

+147
-199
lines changed

1 file changed

+147
-199
lines changed

.github/workflows/release.yaml

Lines changed: 147 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -43,222 +43,170 @@ jobs:
4343
custom_version: ${{ inputs.custom_version }}
4444
existing_changelog_path: CHANGELOG.md
4545

46-
#update_changelog:
47-
# needs: [ release_metadata ]
48-
# name: Update changelog
49-
# runs-on: ubuntu-latest
50-
# outputs:
51-
# changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }}
52-
53-
# steps:
54-
# - name: Checkout repository
55-
# uses: actions/checkout@v4
56-
# with:
57-
# token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
58-
59-
# - name: Use Node.js 22
60-
# uses: actions/setup-node@v4
61-
# with:
62-
# node-version: 22
63-
64-
# - name: Update package version in package.json
65-
# run: npm version --no-git-tag-version --allow-same-version ${{ needs.release_metadata.outputs.version_number }}
66-
67-
# - name: Update manifest.json version
68-
# run: jq '.version = "${{ needs.release_metadata.outputs.version_number }}"' manifest.json > manifest.json.tmp && mv manifest.json.tmp manifest.json
69-
70-
# - name: Update server.json version
71-
# run: |
72-
# EXPECTED_VERSION="${{ needs.release_metadata.outputs.version_number }}"
73-
# jq --arg version "$EXPECTED_VERSION" '.version = $version | .packages[0].version = $version' server.json > server.json.tmp && mv server.json.tmp server.json
74-
# echo "Updated server.json to version $EXPECTED_VERSION"
75-
76-
# - name: Update CHANGELOG.md
77-
# uses: DamianReeves/write-file-action@master
78-
# with:
79-
# path: CHANGELOG.md
80-
# write-mode: overwrite
81-
# contents: ${{ needs.release_metadata.outputs.changelog }}
46+
update_changelog:
47+
needs: [ release_metadata ]
48+
name: Update changelog
49+
runs-on: ubuntu-latest
50+
outputs:
51+
changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }}
8252

83-
# - name: Commit changes
84-
# id: commit
85-
# uses: EndBug/add-and-commit@v9
86-
# with:
87-
# author_name: Apify Release Bot
88-
# author_email: [email protected]
89-
# message: "chore(release): Update changelog, server.json, package.json and manifest.json versions [skip ci]"
53+
steps:
54+
- name: Checkout repository
55+
uses: actions/checkout@v4
56+
with:
57+
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
9058

91-
#create_github_release:
92-
# name: Create github release
93-
# needs: [release_metadata, update_changelog]
94-
# runs-on: ubuntu-latest
95-
# env:
96-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97-
# steps:
98-
# - uses: actions/checkout@v4
99-
# with:
100-
# ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
101-
# - name: Verify commit SHA
102-
# run: |
103-
# CURRENT_SHA=$(git rev-parse HEAD)
104-
# EXPECTED_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}"
105-
# echo "Expected commit SHA: $EXPECTED_SHA"
106-
# echo "Actual checked out SHA: $CURRENT_SHA"
107-
# if [ "$EXPECTED_SHA" != "$CURRENT_SHA" ]; then
108-
# echo "ERROR: Checked out SHA differs from expected!"
109-
# exit 1
110-
# else
111-
# echo "✓ Commit SHA matches expected"
112-
# fi
113-
# - name: Verify manifest.json version
114-
# run: |
115-
# EXPECTED_VERSION="${{ needs.release_metadata.outputs.version_number }}"
116-
# ACTUAL_VERSION=$(jq -r '.version' manifest.json)
59+
- name: Use Node.js 22
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: 22
11763

118-
# echo "Expected version: $EXPECTED_VERSION"
119-
# echo "Actual version in manifest.json: $ACTUAL_VERSION"
120-
# echo "Current commit SHA: ${{ needs.update_changelog.outputs.changelog_commitish }}"
64+
- name: Update package version in package.json
65+
run: npm version --no-git-tag-version --allow-same-version ${{ needs.release_metadata.outputs.version_number }}
12166

122-
# if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then
123-
# echo "ERROR: Version mismatch! Expected $EXPECTED_VERSION but found $ACTUAL_VERSION in manifest.json"
124-
# exit 1
125-
# fi
67+
- name: Update manifest.json version
68+
run: jq '.version = "${{ needs.release_metadata.outputs.version_number }}"' manifest.json > manifest.json.tmp && mv manifest.json.tmp manifest.json
12669

127-
# echo "✓ Version check passed: manifest.json has correct version $ACTUAL_VERSION"
128-
# - name: Use Node.js 22
129-
# uses: actions/setup-node@v4
130-
# with:
131-
# node-version: 22
132-
# cache: 'npm'
133-
# cache-dependency-path: 'package-lock.json'
134-
# - name: Install dependencies
135-
# run: |
136-
# echo "access=public" >> .npmrc
137-
# echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
138-
# npm ci
139-
# - name: Build module
140-
# run: npm run build
141-
# - name: Prepare DXT package
142-
# run: |
143-
# mkdir dxt
144-
# cp -r node_modules dxt/node_modules
145-
# cp -r dist dxt/dist
146-
# cp -r docs dxt/docs
147-
# cp package.json dxt/package.json
148-
# cp manifest.json dxt/manifest.json
149-
# - name: Create DXT package
150-
# run: npx -y @anthropic-ai/dxt pack dxt/ actors-mcp-server.dxt
151-
# - name: Copy DXT package
152-
# run: cp actors-mcp-server.dxt apify-mcp-server.dxt
153-
# - name: Create release
154-
# uses: softprops/action-gh-release@v2
155-
# with:
156-
# tag_name: ${{ needs.release_metadata.outputs.tag_name }}
157-
# name: ${{ needs.release_metadata.outputs.version_number }}
158-
# target_commitish: ${{ needs.update_changelog.outputs.changelog_commitish }}
159-
# body: ${{ needs.release_metadata.outputs.release_notes }}
160-
# files: |
161-
# actors-mcp-server.dxt
162-
# apify-mcp-server.dxt
70+
- name: Update CHANGELOG.md
71+
uses: DamianReeves/write-file-action@master
72+
with:
73+
path: CHANGELOG.md
74+
write-mode: overwrite
75+
contents: ${{ needs.release_metadata.outputs.changelog }}
16376

164-
#publish_to_npm:
165-
# name: Publish to NPM
166-
# needs: [ release_metadata, update_changelog ]
167-
# runs-on: ubuntu-latest
168-
# steps:
169-
# - uses: actions/checkout@v4
170-
# with:
171-
# ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
172-
# - name: Verify commit SHA
173-
# run: |
174-
# CURRENT_SHA=$(git rev-parse HEAD)
175-
# EXPECTED_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}"
176-
# echo "Expected commit SHA: $EXPECTED_SHA"
177-
# echo "Actual checked out SHA: $CURRENT_SHA"
178-
# if [ "$EXPECTED_SHA" != "$CURRENT_SHA" ]; then
179-
# echo "ERROR: Checked out SHA differs from expected!"
180-
# exit 1
181-
# else
182-
# echo "✓ Commit SHA matches expected"
183-
# fi
184-
# - name: Verify package.json version
185-
# run: |
186-
# EXPECTED_VERSION="${{ needs.release_metadata.outputs.version_number }}"
187-
# ACTUAL_VERSION=$(jq -r '.version' package.json)
77+
- name: Commit changes
78+
id: commit
79+
uses: EndBug/add-and-commit@v9
80+
with:
81+
author_name: Apify Release Bot
82+
author_email: [email protected]
83+
message: "chore(release): Update changelog, package.json and manifest.json versions [skip ci]"
18884

189-
# echo "Expected version: $EXPECTED_VERSION"
190-
# echo "Actual version in package.json: $ACTUAL_VERSION"
191-
# echo "Current commit SHA: ${{ needs.update_changelog.outputs.changelog_commitish }}"
85+
create_github_release:
86+
name: Create github release
87+
needs: [release_metadata, update_changelog]
88+
runs-on: ubuntu-latest
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
steps:
92+
- uses: actions/checkout@v4
93+
with:
94+
ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
95+
- name: Verify commit SHA
96+
run: |
97+
CURRENT_SHA=$(git rev-parse HEAD)
98+
EXPECTED_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}"
99+
echo "Expected commit SHA: $EXPECTED_SHA"
100+
echo "Actual checked out SHA: $CURRENT_SHA"
101+
if [ "$EXPECTED_SHA" != "$CURRENT_SHA" ]; then
102+
echo "ERROR: Checked out SHA differs from expected!"
103+
exit 1
104+
else
105+
echo "✓ Commit SHA matches expected"
106+
fi
107+
- name: Verify manifest.json version
108+
run: |
109+
EXPECTED_VERSION="${{ needs.release_metadata.outputs.version_number }}"
110+
ACTUAL_VERSION=$(jq -r '.version' manifest.json)
192111
193-
# if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then
194-
# echo "ERROR: Version mismatch! Expected $EXPECTED_VERSION but found $ACTUAL_VERSION in package.json"
195-
# exit 1
196-
# fi
112+
echo "Expected version: $EXPECTED_VERSION"
113+
echo "Actual version in manifest.json: $ACTUAL_VERSION"
114+
echo "Current commit SHA: ${{ needs.update_changelog.outputs.changelog_commitish }}"
197115
198-
# echo "✓ Version check passed: package.json has correct version $ACTUAL_VERSION"
199-
# - name: Use Node.js 22
200-
# uses: actions/setup-node@v4
201-
# with:
202-
# node-version: 22
203-
# cache: 'npm'
204-
# cache-dependency-path: 'package-lock.json'
205-
# - name: Install dependencies
206-
# run: |
207-
# echo "access=public" >> .npmrc
208-
# echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
209-
# npm ci
210-
# - name: Build module
211-
# run: npm run build
212-
# - name: Publish to NPM
213-
# run: npm publish --tag latest
116+
if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then
117+
echo "ERROR: Version mismatch! Expected $EXPECTED_VERSION but found $ACTUAL_VERSION in manifest.json"
118+
exit 1
119+
fi
214120
215-
publish_to_mcp_registry:
216-
name: Publish to MCP Registry
217-
#needs: [ release_metadata, update_changelog, publish_to_npm ]
218-
needs: [ release_metadata ]
121+
echo "✓ Version check passed: manifest.json has correct version $ACTUAL_VERSION"
122+
- name: Use Node.js 22
123+
uses: actions/setup-node@v4
124+
with:
125+
node-version: 22
126+
cache: 'npm'
127+
cache-dependency-path: 'package-lock.json'
128+
- name: Install dependencies
129+
run: |
130+
echo "access=public" >> .npmrc
131+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
132+
npm ci
133+
- name: Build module
134+
run: npm run build
135+
- name: Prepare MCPB package
136+
run: |
137+
mkdir mcpb
138+
cp -r node_modules mcpb/node_modules
139+
cp -r dist mcpb/dist
140+
cp -r docs mcpb/docs
141+
cp package.json mcpb/package.json
142+
cp manifest.json mcpb/manifest.json
143+
cp docs/apify-logo.png mcpb/icon.png
144+
- name: Create MCPB package
145+
# fix version of anthropic-ai/mcpb to 1.1.1 so that we have a reproducible build
146+
run: npx -y @anthropic-ai/[email protected] pack mcpb/ apify-mcp-server.mcpb
147+
- name: Copy MCPB package
148+
run: cp apify-mcp-server.mcpb actors-mcp-server.mcpb
149+
- name: Create release
150+
uses: softprops/action-gh-release@v2
151+
with:
152+
tag_name: ${{ needs.release_metadata.outputs.tag_name }}
153+
name: ${{ needs.release_metadata.outputs.version_number }}
154+
target_commitish: ${{ needs.update_changelog.outputs.changelog_commitish }}
155+
body: ${{ needs.release_metadata.outputs.release_notes }}
156+
files: |
157+
apify-mcp-server.mcpb
158+
actors-mcp-server.mcpb
159+
160+
publish_to_npm:
161+
name: Publish to NPM
162+
needs: [ release_metadata, update_changelog ]
219163
runs-on: ubuntu-latest
220-
permissions:
221-
id-token: write
222-
contents: read
223164
steps:
224165
- uses: actions/checkout@v4
225-
#with:
226-
# ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
227-
#- name: Verify commit SHA
228-
# run: |
229-
# CURRENT_SHA=$(git rev-parse HEAD)
230-
# EXPECTED_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}"
231-
# echo "Expected commit SHA: $EXPECTED_SHA"
232-
# echo "Actual checked out SHA: $CURRENT_SHA"
233-
# if [ "$EXPECTED_SHA" != "$CURRENT_SHA" ]; then
234-
# echo "ERROR: Checked out SHA differs from expected!"
235-
# exit 1
236-
# else
237-
# echo "✓ Commit SHA matches expected"
238-
# fi
239-
#- name: Verify server.json version
240-
# run: |
241-
# EXPECTED_VERSION="${{ needs.release_metadata.outputs.version_number }}"
242-
# ACTUAL_VERSION=$(jq -r '.version' server.json)
166+
with:
167+
ref: ${{ needs.update_changelog.outputs.changelog_commitish }}
168+
- name: Verify commit SHA
169+
run: |
170+
CURRENT_SHA=$(git rev-parse HEAD)
171+
EXPECTED_SHA="${{ needs.update_changelog.outputs.changelog_commitish }}"
172+
echo "Expected commit SHA: $EXPECTED_SHA"
173+
echo "Actual checked out SHA: $CURRENT_SHA"
174+
if [ "$EXPECTED_SHA" != "$CURRENT_SHA" ]; then
175+
echo "ERROR: Checked out SHA differs from expected!"
176+
exit 1
177+
else
178+
echo "✓ Commit SHA matches expected"
179+
fi
180+
- name: Verify package.json version
181+
run: |
182+
EXPECTED_VERSION="${{ needs.release_metadata.outputs.version_number }}"
183+
ACTUAL_VERSION=$(jq -r '.version' package.json)
243184
244-
# echo "Expected version: $EXPECTED_VERSION"
245-
# echo "Actual version in server.json: $ACTUAL_VERSION"
246-
# echo "Current commit SHA: ${{ needs.update_changelog.outputs.changelog_commitish }}"
185+
echo "Expected version: $EXPECTED_VERSION"
186+
echo "Actual version in package.json: $ACTUAL_VERSION"
187+
echo "Current commit SHA: ${{ needs.update_changelog.outputs.changelog_commitish }}"
247188
248-
# if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then
249-
# echo "ERROR: Version mismatch! Expected $EXPECTED_VERSION but found $ACTUAL_VERSION in server.json"
250-
# exit 1
251-
# fi
189+
if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then
190+
echo "ERROR: Version mismatch! Expected $EXPECTED_VERSION but found $ACTUAL_VERSION in package.json"
191+
exit 1
192+
fi
252193
253-
# echo "✓ Version check passed: server.json has correct version $ACTUAL_VERSION"
254-
- name: Install MCP Publisher
194+
echo "✓ Version check passed: package.json has correct version $ACTUAL_VERSION"
195+
- name: Use Node.js 22
196+
uses: actions/setup-node@v4
197+
with:
198+
node-version: 22
199+
cache: 'npm'
200+
cache-dependency-path: 'package-lock.json'
201+
- name: Install dependencies
255202
run: |
256-
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
257-
chmod +x mcp-publisher
258-
- name: Login to MCP Registry
259-
run: ./mcp-publisher login github-oidc
260-
- name: Publish to MCP Registry
261-
run: ./mcp-publisher publish
203+
echo "access=public" >> .npmrc
204+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
205+
npm ci
206+
- name: Build module
207+
run: npm run build
208+
- name: Publish to NPM
209+
run: npm publish --tag latest
262210

263211
env:
264212
NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}

0 commit comments

Comments
 (0)