Skip to content

CI

CI #101

Workflow file for this run

name: CI
permissions:
contents: write
on:
schedule:
- cron: "0 0 * * *"
jobs:
version_check:
name: Version Check
outputs:
UPSTREAM_VERSION: "${{ steps.latest-releases.outputs.upstream-version }}"
RELEASES_VERSION: "${{ steps.latest-releases.outputs.releases-version }}"
runs-on: ubuntu-latest
timeout-minutes: 600
steps:
- name: Check latest release in upstream
id: latest-releases
run: |
get_latest_release() {
URL="https://github.com/$1/$2/releases/latest"
VERSION=$(curl -is "$URL" \
| grep location \
| awk -F '/' '{print $8}')
echo "${VERSION/$'\r'/}"
}
UPS_VER="$(get_latest_release 'microsoft' 'java-debug')"
REL_VER="$(get_latest_release 'nvim-java' 'vscode-java-debug-releases')"
echo "upstream-version=$UPS_VER" >> "$GITHUB_OUTPUT"
echo "releases-version=$REL_VER" >> "$GITHUB_OUTPUT"
linux:
name: "Release"
needs: version_check
if: needs.version_check.outputs.UPSTREAM_VERSION != needs.version_check.outputs.RELEASES_VERSION
runs-on: ubuntu-latest
env:
VERSION: "${{ needs.version_check.outputs.UPSTREAM_VERSION }}"
steps:
- name: Check with current version
run: |
wget "https://github.com/microsoft/java-debug/archive/refs/tags/${VERSION}.tar.gz"
tar xf "${VERSION}.tar.gz" -C . --strip-components=1
# git clone "https://github.com/microsoft/java-debug.git" .
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: "17"
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Verify
run: ./mvnw clean verify
- name: Checkstyle
run: ./mvnw checkstyle:check
- name: Prepare Artifacts
run: |
mkdir -p extension/server
mv \
"com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-${VERSION}.jar" \
extension/server
zip -r "artifacts.zip" extension
- uses: ncipollo/release-action@v1
with:
artifacts: "artifacts.zip"
allowUpdates: true
artifactErrorsFailBuild: true
name: "${{ env.VERSION }}"
tag: "${{ env.VERSION }}"