Skip to content

Commit

Permalink
update CI to run on tag creation
Browse files Browse the repository at this point in the history
  • Loading branch information
sestinj committed Aug 10, 2024
1 parent 1e5a7b0 commit 4beb81e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 46 deletions.
52 changes: 7 additions & 45 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Publish Preview Extension

on:
push:
branches:
- preview
create:
tags:
- "v*"
Expand Down Expand Up @@ -50,8 +47,13 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
# 1. Check-out repository
- name: Check-out repository
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # This ensures all tags are fetched

- name: Checkout tag
run: git checkout ${GITHUB_REF#refs/tags/}

# 2. Install npm dependencies
- name: Use Node.js from .nvmrc
Expand Down Expand Up @@ -163,20 +165,10 @@ jobs:
# Download the .vsix artifacts
- uses: actions/download-artifact@v3

- name: Tag the repository
id: tag
run: |
# See https://docs.github.com/en/get-started/using-git/dealing-with-special-characters-in-branch-and-tag-names
TAG=v$(grep -o '"version": "[^"]*' extensions/vscode/package.json | cut -d'"' -f4)-vscode
echo "$TAG"
echo "tag=$TAG" >> $GITHUB_OUTPUT
git tag -a $TAG -m "Published version $TAG" ${GITHUB_SHA}
git push origin $TAG
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
tag_name: ${{ github.ref_name }}
files: |
alpine-x64/*.vsix
darwin-arm64/*.vsix
Expand All @@ -190,36 +182,6 @@ jobs:
repository: continuedev/continue
prerelease: true

release-branch:
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create release branch
run: |
# Set up Git
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
# Get the current version
current_version=$(grep -o '"version": "[^"]*' extensions/vscode/package.json | cut -d'"' -f4)
# Create a new branch name
new_branch="release-${current_version}"
# Create and checkout the new branch
git checkout -b $new_branch
# Push the new branch to the remote repository
git push origin $new_branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
runs-on: ubuntu-latest
needs:
Expand Down
2 changes: 1 addition & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "0.9.197",
"version": "0.9.196",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
Expand Down

0 comments on commit 4beb81e

Please sign in to comment.