Skip to content

ci: Add Java to the release workflow #12

ci: Add Java to the release workflow

ci: Add Java to the release workflow #12

Workflow file for this run

name: Release
on:
push:
tags:
- "*.*.*"
workflow_dispatch:
inputs:
PRERELEASE:
description: "Is this a pre-release?"
required: true
type: boolean
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- uses: actions/setup-java@v3
with:
java-version: '17'
- name: Extract minor version
id: version
run: |
VERSION=${GITHUB_REF#refs/*/}
MINOR_VERSION=$(echo $VERSION | cut -d'.' -f2)
echo "::set-output name=minor_version::$MINOR_VERSION"
echo $MINOR_VERSION
- name: Is Pre-Release
id: prerelease
run: |
PRERELEASE=${{inputs.PRERELEASE}};
if [[ $PRERELEASE == true ]]; then
echo "::set-output name=prerelease::true"
elif [[ $((${{steps.version.outputs.minor_version}} % 2)) -eq 1 ]]; then
echo "::set-output name=prerelease::true"
else
echo "::set-output name=prerelease::false"
fi
- run: npm ci
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
id: publishToOpenVSX
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
skipDuplicate: true
preRelease: ${{ steps.prerelease.outputs.prerelease }}
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
skipDuplicate: true
preRelease: ${{ steps.prerelease.outputs.prerelease }}
- name: Create release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: true
files: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
prerelease: ${{ steps.prerelease.outputs.prerelease }}