-
Notifications
You must be signed in to change notification settings - Fork 23
49 lines (49 loc) · 1.71 KB
/
build-with-cody.yml
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
name: Build with Cody
on:
workflow_dispatch:
inputs:
cody-commit:
description: 'Cody commit to build the plugin with (latest by default)'
required: false
type: string
jobs:
build_with_cody:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
# See note about QEMU and binfmt requirement here https://github.com/vercel/pkg#targets
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v3
- run: yarn global add [email protected]
- run: |
if [ -z "${{ github.event.inputs.cody-commit }}" ]; then
echo "CODY_COMMIT=$(git ls-remote https://github.com/sourcegraph/cody refs/heads/main | cut -f1)" >> $GITHUB_ENV
else
echo "CODY_COMMIT=${{ github.event.inputs.cody-commit }}" >> $GITHUB_ENV
fi
- run: |
git fetch --prune --unshallow
echo "RELEASE_VERSION=$(git describe --tags)-$CODY_COMMIT" >> $GITHUB_ENV
- run: ./gradlew buildPlugin "-PpluginVersion=$RELEASE_VERSION" "-Pcody.commit=$CODY_COMMIT"
- run: ./gradlew --stop
- name: Upload the plugin package
uses: actions/upload-artifact@v4
with:
name: plugin-${{ env.RELEASE_VERSION }}
path: './build/distributions/Sourcegraph-*.zip'
compression-level: 0
retention-days: 3