v0.8.1 #49
Workflow file for this run
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: | |
tags: | |
- v*.*.* | |
branches-ignore: | |
- '**' | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "./go.mod" | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Write VERSION file | |
run: echo -n "${GITHUB_REF:11}" > dist/VERSION | |
- name: Upload binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: iccheck | |
path: dist/* | |
vsce-build: | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
platform: win32 | |
arch: x64 | |
binary_path: iccheck_windows_amd64_v1/iccheck.exe | |
npm_config_arch: x64 | |
- os: windows-latest | |
platform: win32 | |
arch: arm64 | |
binary_path: iccheck_windows_arm64_v8.0/iccheck.exe | |
npm_config_arch: arm | |
- os: ubuntu-latest | |
platform: linux | |
arch: x64 | |
binary_path: iccheck_linux_amd64_v1/iccheck | |
npm_config_arch: x64 | |
- os: ubuntu-latest | |
platform: linux | |
arch: arm64 | |
binary_path: iccheck_linux_arm64_v8.0/iccheck | |
npm_config_arch: arm64 | |
- os: macos-latest | |
platform: darwin | |
arch: x64 | |
binary_path: iccheck_darwin_amd64_v1/iccheck | |
npm_config_arch: x64 | |
- os: macos-latest | |
platform: darwin | |
arch: arm64 | |
binary_path: iccheck_darwin_arm64_v8.0/iccheck | |
npm_config_arch: arm64 | |
runs-on: ${{ matrix.os }} | |
needs: | |
- goreleaser | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: iccheck | |
path: dist | |
- name: Check artifacts | |
run: ls dist | |
- name: Place binary (windows) | |
if: "${{ startsWith(matrix.binary_path, 'windows') }}" | |
run: mv dist/${{ matrix.binary_path }} ./plugins/vscode/iccheck.exe | |
- name: Place binary (non-windows) | |
if: "${{ !startsWith(matrix.binary_path, 'windows') }}" | |
run: mv dist/${{ matrix.binary_path }} ./plugins/vscode/iccheck | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- run: npm install | |
working-directory: ./plugins/vscode | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
npm_config_arch: ${{ matrix.npm_config_arch }} | |
- shell: pwsh | |
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV | |
- run: npx @vscode/vsce package --target ${{ env.target }} | |
working-directory: ./plugins/vscode | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: "plugin-${{ env.target }}" | |
path: "plugins/vscode/*.vsix" | |
vsce-publish: | |
runs-on: ubuntu-latest | |
needs: | |
- vsce-build | |
if: success() && startsWith( github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: "plugin-*" | |
- run: npx @vscode/vsce publish --packagePath $(find . -iname *.vsix) | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
# https://github.com/JetBrains/intellij-platform-plugin-template/blob/main/.github/workflows/release.yml | |
# Prepare and publish the plugin to JetBrains Marketplace repository | |
jetbrains-publish: | |
name: Publish IntelliJ Plugin | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
needs: | |
- goreleaser | |
steps: | |
# Check out the current repository | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Get version | |
run: echo "VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV | |
- uses: cardinalby/git-get-release-action@v1 | |
id: get-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: 'v${{ env.VERSION }}' | |
# Set up Java environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 17 | |
# Setup Gradle | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-home-cache-cleanup: true | |
# Set environment variables | |
- name: Export Properties | |
id: properties | |
shell: bash | |
run: | | |
CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d' | |
${{ steps.get-release.outputs.body }} | |
EOM | |
)" | |
echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
echo "$CHANGELOG" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
# Update Unreleased section with the current release note | |
- name: Patch Changelog | |
if: ${{ steps.properties.outputs.changelog != '' }} | |
env: | |
CHANGELOG: ${{ steps.properties.outputs.changelog }} | |
run: | | |
cd ./plugins/intellij | |
./gradlew patchChangelog --release-note="$CHANGELOG" | |
# Publish the plugin to JetBrains Marketplace | |
- name: Publish Plugin | |
env: | |
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_PUBLISH_TOKEN }} | |
CERTIFICATE_CHAIN: ${{ secrets.JETBRAINS_CERTIFICATE_CHAIN }} | |
PRIVATE_KEY: ${{ secrets.JETBRAINS_PRIVATE_KEY }} | |
PRIVATE_KEY_PASSWORD: ${{ secrets.JETBRAINS_PRIVATE_KEY_PASSWORD }} | |
run: | | |
cd ./plugins/intellij | |
./gradlew publishPlugin | |
# Create a pull request | |
- name: Create Pull Request | |
if: ${{ steps.properties.outputs.changelog != '' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
BRANCH="intellij-changelog-update-$VERSION" | |
LABEL="release changelog" | |
git config user.email "action@github.com" | |
git config user.name "GitHub Action" | |
git checkout -b $BRANCH | |
git commit -am "IntelliJ Changelog Update - $VERSION" | |
git push --set-upstream origin $BRANCH | |
gh label create "$LABEL" \ | |
--description "Pull requests with release changelog update" \ | |
--force \ | |
|| true | |
gh pr create \ | |
--title "Changelog update - \`$VERSION\`" \ | |
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \ | |
--label "$LABEL" \ | |
--head $BRANCH |