-
Notifications
You must be signed in to change notification settings - Fork 475
153 lines (128 loc) · 4.52 KB
/
freebuff-release.yml
File metadata and controls
153 lines (128 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Freebuff Release
on:
workflow_dispatch:
inputs:
version_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
concurrency:
group: freebuff-release
cancel-in-progress: false
permissions:
contents: write
jobs:
prepare-and-commit:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.bump_version.outputs.new_version }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/setup-project
- name: Calculate and update version
id: bump_version
run: |
cd freebuff/cli/release
CURRENT_VERSION=$(bun -e "console.log(require('./package.json').version)")
echo "Current version: $CURRENT_VERSION"
npm version ${{ inputs.version_type }} --no-git-tag-version
NEW_VERSION=$(bun -e "console.log(require('./package.json').version)")
echo "New Freebuff version: $NEW_VERSION"
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and push version bump
run: |
git stash
git pull --rebase origin main
git stash pop
git add freebuff/cli/release/package.json
git commit -m "Bump Freebuff version to ${{ steps.bump_version.outputs.new_version }}"
git push
- name: Create and push tag
run: |
git tag "freebuff-v${{ steps.bump_version.outputs.new_version }}"
git push origin "freebuff-v${{ steps.bump_version.outputs.new_version }}"
- name: Upload updated package
uses: actions/upload-artifact@v4
with:
name: freebuff-updated-package
path: freebuff/cli/release/
build-binaries:
needs: prepare-and-commit
uses: ./.github/workflows/cli-release-build.yml
with:
binary-name: freebuff
new-version: ${{ needs.prepare-and-commit.outputs.new_version }}
artifact-name: freebuff-updated-package
checkout-ref: ${{ github.sha }}
env-overrides: '{"FREEBUFF_MODE": "true", "NEXT_PUBLIC_CB_ENVIRONMENT": "prod"}'
secrets: inherit
create-release:
needs: [prepare-and-commit, build-binaries]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all binary artifacts
uses: actions/download-artifact@v4
with:
path: binaries/
- name: Download updated package
uses: actions/download-artifact@v4
with:
name: freebuff-updated-package
path: freebuff/cli/release/
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: freebuff-v${{ needs.prepare-and-commit.outputs.new_version }}
name: Freebuff v${{ needs.prepare-and-commit.outputs.new_version }}
prerelease: false
body: |
## Freebuff v${{ needs.prepare-and-commit.outputs.new_version }}
Free AI coding assistant — binary releases for all supported platforms.
### Installation
```bash
npm install -g freebuff
```
### Platform Binaries
- `freebuff-linux-x64.tar.gz` - Linux x64
- `freebuff-linux-arm64.tar.gz` - Linux ARM64
- `freebuff-darwin-x64.tar.gz` - macOS Intel
- `freebuff-darwin-arm64.tar.gz` - macOS Apple Silicon
- `freebuff-win32-x64.tar.gz` - Windows x64
files: |
binaries/*/freebuff-*
repository: CodebuffAI/codebuff-community
token: ${{ secrets.CODEBUFF_GITHUB_TOKEN }}
publish-npm:
needs: [prepare-and-commit, create-release]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Download updated package
uses: actions/download-artifact@v4
with:
name: freebuff-updated-package
path: freebuff/cli/release/
- name: Set up Node.js for npm publishing
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Publish to npm
run: |
cd freebuff/cli/release
npm publish --access public --provenance