Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Release CLI
on:
workflow_call:
inputs:
tag:
description: Git tag to release assets for.
required: true
type: string

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: refs/tags/${{ inputs.tag }}

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8

- uses: coursier/setup-action@v3
with:
apps: ''

- name: Build standalone launcher
shell: bash
env:
TAG: ${{ inputs.tag }}
VERSION: ${{ inputs.tag }}
run: |
set -euo pipefail

VERSION=${VERSION#v}
ARTIFACT="com.sourcegraph:scip-java_2.13:${VERSION}"

for attempt in {1..10}; do
if cs resolve "$ARTIFACT" >/dev/null 2>&1; then
break
fi

if [ "$attempt" -eq 10 ]; then
echo "Artifact $ARTIFACT was not resolvable after 10 attempts" >&2
exit 1
fi

sleep 30
done

cs bootstrap \
--standalone \
--bat=true \
-o scip-java \
"$ARTIFACT" \
--main com.sourcegraph.scip_java.ScipJava

chmod +x scip-java
./scip-java --help >/dev/null

mv scip-java "scip-java-${TAG}"
mv scip-java.bat "scip-java-${TAG}.bat"
shasum -a 256 "scip-java-${TAG}" "scip-java-${TAG}.bat" > "scip-java-${TAG}.sha256"

- name: Ensure GitHub release exists
shell: bash
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ inputs.tag }}
run: |
set -euo pipefail

if ! gh release view "$TAG" >/dev/null 2>&1; then
gh release create "$TAG" --verify-tag --title "$TAG" --notes ""
fi

- name: Upload release assets
shell: bash
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ inputs.tag }}
run: |
set -euo pipefail

gh release upload "$TAG" \
"scip-java-${TAG}" \
"scip-java-${TAG}.bat" \
"scip-java-${TAG}.sha256" \
--clobber
10 changes: 10 additions & 0 deletions .github/workflows/release-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches: [main]
tags: ["*"]

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -23,3 +24,12 @@ jobs:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

release-cli:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: publish
permissions:
contents: write
uses: ./.github/workflows/release-cli.yml
with:
tag: ${{ github.ref_name }}
Loading