-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (80 loc) · 3.06 KB
/
build.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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