IntelliJ Update #516
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: Release | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 * * 0' # Every Sunday | |
jobs: | |
publish: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Read version from Git ref | |
id: version | |
shell: pwsh | |
run: echo "version=$(if ($env:GITHUB_REF.StartsWith('refs/tags/v')) { $env:GITHUB_REF -replace '^refs/tags/v', '' } else { 'next' })" >> $env:GITHUB_OUTPUT | |
- name: "Check out the sources" | |
uses: actions/checkout@v4 | |
- name: Cache downloaded JDK | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.local/share/gradle-jvm | |
~/AppData/Local/gradle-jvm | |
key: ${{ runner.os }}-${{ hashFiles('gradlew*') }} | |
- name: Read the changelog | |
uses: ForNeVeR/ChangelogAutomation.action@v2 | |
with: | |
input: ./CHANGELOG.md | |
output: ./changelog-section.md | |
- name: Upload the changelog | |
uses: actions/upload-artifact@v4 | |
with: | |
name: changelog-section.md | |
path: ./changelog-section.md | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build the plugin | |
run: ./gradlew buildPlugin | |
- name: Unpack distribution # for the purpose of uploading | |
shell: pwsh | |
run: src/scripts/Unpack-Distribution.ps1 | |
- name: Upload the artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PowerShell-${{ steps.version.outputs.version }} | |
path: build/distributions/unpacked | |
- name: Create a release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: intellij-powershell v${{ steps.version.outputs.version }} | |
body_path: ./changelog-section.md | |
files: | | |
build/distributions/PowerShell-${{ steps.version.outputs.version }}.zip | |
- name: Publish | |
if: startsWith(github.ref, 'refs/tags/v') | |
shell: pwsh | |
run: src/scripts/Publish-Distribution.ps1 -AuthToken $env:JETBRAINS_MARKETPLACE_TOKEN | |
env: | |
JETBRAINS_MARKETPLACE_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }} |