Release #7
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-22.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: Checkout | |
uses: actions/checkout@v4 | |
- name: Read the changelog | |
uses: ForNeVeR/ChangelogAutomation.action@v1 | |
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: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: "Cache downloads" | |
uses: actions/cache@v4 | |
with: | |
path: "build/download" | |
key: ${{ hashFiles('gradle.properties') }} | |
- 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 }} |