Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sestinj committed Aug 10, 2024
1 parent a6ba8f0 commit ca3ea25
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 39 deletions.
69 changes: 31 additions & 38 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Publish Extension

on:
push:
branches:
- main
pull_request:
types: [closed]
create:
tags:
- "v0.8.*-vscode"
branches:
- main

Expand Down Expand Up @@ -49,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/}

- name: Make sure version isn't odd
run: |
Expand Down Expand Up @@ -99,14 +102,6 @@ jobs:
cd core
npm ci
# 2.25 Run core tests
- name: Run core tests
run: |
cd core
npm run test
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

# 2.5. Pre package
- name: Set var for environment info
shell: pwsh
Expand All @@ -117,6 +112,14 @@ jobs:
cd extensions/vscode
npm run prepackage -- --target ${{ env.target }}
# 2.75 Run core tests
- name: Run core tests
run: |
cd core
npm run test
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

# 3. Re-install esbuild (for cases that we force installed for another arch in prepackage.js)
- name: Re-install esbuild
run: |
Expand All @@ -125,19 +128,19 @@ jobs:
# 4. Run tests for the extension
# - name: Install Xvfb for Linux and run tests
# run: |
# sudo apt-get install -y xvfb # Install Xvfb
# Xvfb :99 & # Start Xvfb
# export DISPLAY=:99 # Export the display number to the environment
# cd extensions/vscode
# npm run test
# if: matrix.os == 'ubuntu-latest'

- name: Run extension tests
run: |
cd extensions/vscode
npm run test
if: matrix.os != 'ubuntu-latest'
# run: |
# sudo apt-get install -y xvfb # Install Xvfb
# Xvfb :99 & # Start Xvfb
# export DISPLAY=:99 # Export the display number to the environment
# cd extensions/vscode
# npm run test
# if: matrix.os == 'ubuntu-latest'

# - name: Run extension tests
# run: |
# cd extensions/vscode
# npm run test
# if: matrix.os != 'ubuntu-latest'

# 5. Package the extension
- name: Package the extension
Expand Down Expand Up @@ -167,20 +170,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 Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Preview Extension
on:
create:
tags:
- "v*"
- "v0.9.*-vscode"
branches:
- dev

Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ For the sake of rapid development, it is also possible to configure this communi

If you make changes to Kotlin code, they can often be hot-reloaded with "Run -> Debugging Actions -> Reload Changed Classes".

### Our Git Workflow

We keep two permanent branches: `main` and `dev`. All contributions should be made as pull requests to the `dev` branch. When we are ready to create a "pre-release" version, we create a tag on the `dev` branch, which automatically triggers the workflow in [preview.yaml](./.github/workflows/preview.yaml), which builds and releases a version of the VS Code extension. When a release has been sufficiently tested, we will merge its tag into the `main` branch. Creating a tag on the `main` branch will then trigger a similar workflow in [main.yaml](./.github/workflows/main.yaml), which will build and release a main release of the VS Code extension. Any hotfixes can be made by creating a feature branch from the tag for the release in question.

### Formatting

Continue uses [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) to format JavaScript/TypeScript. Please install the Prettier extension in VS Code and enable "Format on Save" in your settings.
Expand Down
File renamed without changes.

0 comments on commit ca3ea25

Please sign in to comment.