Fix release version #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Text | |
on: | |
push: | |
branches: [ release/* ] | |
pull_request: | |
branches: [ release/* ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ windows-latest, macos-latest, ubuntu-latest ] | |
steps: | |
- name: π Fetch Sources | |
uses: actions/checkout@v3 | |
- name: π Import environment | |
uses: ./.github/workflows/environment | |
- name: π§ Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: π Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: π Setup .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.200' | |
- name: π§ Prepare build devenv | |
uses: gradle/gradle-build-action@v2 | |
with: | |
cache-disabled: true | |
arguments: prepare | |
- name: π Build Plugin (Stable) | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: buildPlugin | |
- name: π¦ Prepare artifacts folder | |
shell: pwsh | |
run: | | |
mkdir artifacts | |
- name: π¦ Emit metadata artifacts | |
shell: pwsh | |
run: | | |
$PROPERTIES = ./gradlew properties | |
$VERSION_ROW = $PROPERTIES | Select-String "pluginVersion" | |
$VERSION = ($VERSION_ROW -split ':')[1].Trim() | |
$PLUGIN_ID_ROW = $PROPERTIES | Select-String "riderPluginId" | |
$PLUGIN_ID = ($PLUGIN_ID_ROW -split ':')[1].Trim() | |
echo "PLUGIN_VERSION=$VERSION" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
echo $VERSION > ${{ env.ARTIFACTS_FOLDER }}/${{ env.ARTIFACTS_VERSION }} | |
echo "PLUGIN_ID=$PLUGIN_ID" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
echo $PLUGIN_ID > ${{ env.ARTIFACTS_FOLDER }}/${{ env.ARTIFACTS_PLUGIN_ID }} | |
- name: π¦ Emit plugin archive artifact | |
shell: pwsh | |
run: | | |
Get-ChildItem -Path "build\distributions\*.zip" | | |
Move-Item -Destination "${{ env.ARTIFACTS_FOLDER }}\${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip" -Force | |
- name: π¦ Emit changelog artifact | |
shell: pwsh | |
run: | | |
$CHANGELOG = (./gradlew getChangelog --console=plain -q --no-header) | |
# We need to escape CHANGELOG because it will be transferred over HTTP for GitHub Release creation | |
$CHANGELOG = $CHANGELOG -replace '%', '%25' | |
$CHANGELOG = $CHANGELOG -replace "`n", '%0A' | |
$CHANGELOG = $CHANGELOG -replace "`r", '%0D' | |
echo $CHANGELOG | |
echo $CHANGELOG > ${{ env.ARTIFACTS_FOLDER }}/${{ env.ARTIFACTS_CHANGELOG }} | |
- name: π¦ Tree artifacts | |
shell: pwsh | |
run: | | |
tree ${{ env.ARTIFACTS_FOLDER }} | |
- name: π¦ Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: plugin-artifacts-${{ matrix.os }} | |
path: ${{ env.ARTIFACTS_FOLDER }}/ | |
if-no-files-found: error |