Skip to content

Icecode Release

Icecode Release #1

name: Icecode Release
on:
workflow_dispatch:
inputs:
version_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
checkout_ref:
description: 'Git ref to build from (commit SHA, branch, or tag). Defaults to latest main.'
required: false
default: ''
type: string
concurrency:
group: icecode-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@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/setup-project
- name: Calculate and update version
id: bump_version
run: |
cd 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 icecode 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"
# Inject token into remote URL to avoid HTTPS auth prompt
git remote set-url origin https://x-access-token:${{ secrets.ICECODE_GITHUB_TOKEN }}@github.com/${{ github.repository }}
- name: Commit and push version bump
run: |
git stash
git pull --rebase origin main
git stash pop
git add cli/release/package.json
git commit -m "Bump icecode version to ${{ steps.bump_version.outputs.new_version }}"
git push
- name: Create and push tag
run: |
git tag "icecode-v${{ steps.bump_version.outputs.new_version }}"
git push origin "icecode-v${{ steps.bump_version.outputs.new_version }}"
- name: Upload updated package
uses: actions/upload-artifact@v6
with:
name: icecode-updated-package
path: cli/release/
build-binaries:
needs: prepare-and-commit
uses: ./.github/workflows/cli-release-build.yml
with:
binary-name: icecode
new-version: ${{ needs.prepare-and-commit.outputs.new_version }}
artifact-name: icecode-updated-package
checkout-ref: ${{ inputs.checkout_ref || github.sha }}
env-overrides: '{"FREEBUFF_MODE":"true","NEXT_PUBLIC_CB_ENVIRONMENT":"prod","NEXT_PUBLIC_CODEBUFF_APP_URL":"https://icecode.com","NEXT_PUBLIC_SUPPORT_EMAIL":"support@icecode.com","NEXT_PUBLIC_POSTHOG_API_KEY":"phc_placeholder","NEXT_PUBLIC_POSTHOG_HOST_URL":"https://app.posthog.com","NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY":"pk_test_placeholder","NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL":"https://example.com/portal","NEXT_PUBLIC_WEB_PORT":"3000"}'
secrets: inherit
create-release:
needs: [prepare-and-commit, build-binaries]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download all binary artifacts
uses: actions/download-artifact@v8
with:
path: binaries/
- name: Download updated package
uses: actions/download-artifact@v8
with:
name: icecode-updated-package
path: cli/release/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: icecode-v${{ needs.prepare-and-commit.outputs.new_version }}
name: Icecode v${{ needs.prepare-and-commit.outputs.new_version }}
prerelease: false
body: |
## Icecode v${{ needs.prepare-and-commit.outputs.new_version }}
AI coding agent in your terminal.
### Installation
```bash
npm install -g icecode
```
### Platform Binaries
- `icecode-linux-x64.tar.gz` - Linux x64
- `icecode-linux-arm64.tar.gz` - Linux ARM64
- `icecode-darwin-x64.tar.gz` - macOS Intel
- `icecode-darwin-arm64.tar.gz` - macOS Apple Silicon
- `icecode-win32-x64.tar.gz` - Windows x64
files: |
binaries/*/icecode-*
token: ${{ secrets.ICECODE_GITHUB_TOKEN }}