Skip to content

Commit af7b6d7

Browse files
committed
tweak workflows
1 parent c88fc69 commit af7b6d7

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

.github/workflows/npm-app-release-legacy.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ permissions:
1717
contents: write
1818

1919
jobs:
20-
# First job: Prepare production release
21-
prepare-and-commit-prod:
20+
# First job: Prepare legacy release
21+
prepare-and-commit-legacy:
2222
runs-on: ubuntu-latest
2323
outputs:
2424
new_version: ${{ steps.bump_version.outputs.new_version }}
@@ -29,10 +29,10 @@ jobs:
2929

3030
- uses: ./.github/actions/setup-project
3131

32-
- name: Calculate and update production version
32+
- name: Calculate and update legacy version
3333
id: bump_version
3434
run: |
35-
cd npm-app/release
35+
cd npm-app/release-legacy
3636
3737
# Get current version and bump it
3838
CURRENT_VERSION=$(bun -e "console.log(require('./package.json').version)")
@@ -42,7 +42,7 @@ jobs:
4242
npm version ${{ inputs.version_type }} --preid=legacy --no-git-tag-version
4343
NEW_VERSION=$(bun -e "console.log(require('./package.json').version)")
4444
45-
echo "New production version: $NEW_VERSION"
45+
echo "New legacy version: $NEW_VERSION"
4646
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
4747
4848
- name: Configure git
@@ -55,11 +55,11 @@ jobs:
5555
git stash
5656
git pull --rebase origin main
5757
git stash pop
58-
git add npm-app/release/package.json
58+
git add npm-app/release-legacy/package.json
5959
git commit -m "Bump version to ${{ steps.bump_version.outputs.new_version }}"
6060
git push
6161
62-
- name: Create and push production tag
62+
- name: Create and push legacy tag
6363
run: |
6464
git tag "v${{ steps.bump_version.outputs.new_version }}"
6565
git push origin "v${{ steps.bump_version.outputs.new_version }}"
@@ -68,22 +68,22 @@ jobs:
6868
uses: actions/upload-artifact@v4
6969
with:
7070
name: updated-package
71-
path: npm-app/release/
71+
path: npm-app/release-legacy/
7272

73-
build-prod-binaries:
74-
needs: prepare-and-commit-prod
73+
build-legacy-binaries:
74+
needs: prepare-and-commit-legacy
7575
uses: ./.github/workflows/npm-app-release-build.yml
7676
with:
7777
binary-name: codebuff
78-
new-version: ${{ needs.prepare-and-commit-prod.outputs.new_version }}
78+
new-version: ${{ needs.prepare-and-commit-legacy.outputs.new_version }}
7979
artifact-name: updated-package
8080
checkout-ref: ${{ github.sha }}
8181
env-overrides: '{"NEXT_PUBLIC_CODEBUFF_BACKEND_URL": "manicode-backend.onrender.com", "NEXT_PUBLIC_CB_ENVIRONMENT": "prod"}'
8282
secrets: inherit
8383

8484
# Create GitHub release with all binaries
85-
create-prod-release:
86-
needs: [prepare-and-commit-prod, build-prod-binaries]
85+
create-legacy-release:
86+
needs: [prepare-and-commit-legacy, build-legacy-binaries]
8787
runs-on: ubuntu-latest
8888
steps:
8989
- uses: actions/checkout@v4
@@ -102,11 +102,11 @@ jobs:
102102
- name: Create GitHub Release
103103
uses: softprops/action-gh-release@v1
104104
with:
105-
tag_name: v${{ needs.prepare-and-commit-prod.outputs.new_version }}
106-
name: Release v${{ needs.prepare-and-commit-prod.outputs.new_version }}
105+
tag_name: v${{ needs.prepare-and-commit-legacy.outputs.new_version }}
106+
name: Release v${{ needs.prepare-and-commit-legacy.outputs.new_version }}
107107
prerelease: false
108108
body: |
109-
## Codebuff v${{ needs.prepare-and-commit-prod.outputs.new_version }}
109+
## Codebuff v${{ needs.prepare-and-commit-legacy.outputs.new_version }}
110110
111111
Binary releases for all supported platforms.
112112
@@ -127,8 +127,8 @@ jobs:
127127
token: ${{ secrets.CODEBUFF_GITHUB_TOKEN }}
128128

129129
# Publish npm package
130-
publish-prod-npm:
131-
needs: [prepare-and-commit-prod, create-prod-release]
130+
publish-legacy-npm:
131+
needs: [prepare-and-commit-legacy, create-legacy-release]
132132
runs-on: ubuntu-latest
133133
permissions:
134134
contents: read
@@ -140,7 +140,7 @@ jobs:
140140
uses: actions/download-artifact@v4
141141
with:
142142
name: updated-package
143-
path: npm-app/release/
143+
path: npm-app/release-legacy/
144144

145145
- name: Set up Node.js for npm publishing
146146
uses: actions/setup-node@v4
@@ -150,7 +150,7 @@ jobs:
150150

151151
- name: Publish to npm
152152
run: |
153-
cd npm-app/release
153+
cd npm-app/release-legacy
154154
npm publish --access public --tag legacy
155155
env:
156156
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

npm-app/scripts/release-legacy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { execSync } = require('child_process')
44

55
// Parse command line arguments
66
const args = process.argv.slice(2)
7-
const versionType = args[0] || 'patch' // patch, minor, major, or specific version like 1.2.3
7+
const versionType = args[0] || 'prepatch' // prepatch, minor, major, or specific version like 1.2.3
88

99
function log(message) {
1010
console.log(`${message}`)
@@ -33,10 +33,10 @@ function checkGitHubToken() {
3333
if (!token) {
3434
error(
3535
'CODEBUFF_GITHUB_TOKEN environment variable is required but not set.\n' +
36-
'Please set it with your GitHub personal access token or use the infisical setup.'
36+
'Please set it with your GitHub personal access token or use the infisical setup.',
3737
)
3838
}
39-
39+
4040
// Set GITHUB_TOKEN for compatibility with existing curl commands
4141
process.env.GITHUB_TOKEN = token
4242
return token

0 commit comments

Comments
 (0)