-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- 'src/**' | ||
- 'generate/**' | ||
- 'gradle.properties' | ||
- 'package.json' | ||
- '**.gradle.kts' | ||
pull_request: | ||
paths: | ||
- 'src/**' | ||
- 'generate/**' | ||
- 'gradle.properties' | ||
- 'package.json' | ||
- '**.gradle.kts' | ||
|
||
jobs: | ||
build: | ||
name: Build Plugin | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
java-version: 17 | ||
cache: 'gradle' | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
cache: yarn | ||
|
||
- name: Install Deps | ||
run: yarn install | ||
|
||
- name: Generate Icons | ||
run: yarn build | ||
|
||
- name: Build Plugin | ||
run: ./gradlew buildPlugin | ||
|
||
- name: Upload JAR(s) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "Catppuccin Icons" | ||
path: build/libs/*.jar | ||
|
||
- name: Output Unreleased Changes | ||
run: | | ||
echo "# 🚧 Unreleased 🚧" >> $GITHUB_STEP_SUMMARY | ||
echo "$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" >> $GITHUB_STEP_SUMMARY |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Workflow Description: | ||
# - Generates icons from catppuccin/vscode | ||
# - Patches the `CHANGELOG.md` into the `.jar` for updated release notes | ||
# - Builds the `.jar` | ||
# - Publishes to the JetBrains Marketplace | ||
# - Creates a draft release on GitHub for maintainers with the new `.jar` to manually review and release | ||
|
||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
build: | ||
name: Publish Plugin | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
java-version: 17 | ||
cache: 'gradle' | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
cache: yarn | ||
|
||
- name: Install Deps | ||
run: yarn install | ||
|
||
- name: Generate Icons | ||
run: yarn build | ||
|
||
- name: Export Properties | ||
run: | | ||
PROPERTIES="$(./gradlew properties --console=plain -q)" | ||
echo "version=$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" >> $GITHUB_ENV | ||
echo "name=$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" >> $GITHUB_ENV | ||
- name: Patch Changelog | ||
run: ./gradlew patchChangelog | ||
|
||
- name: Build Plugin | ||
run: ./gradlew buildPlugin | ||
|
||
- name: Upload JAR | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.name }}-${{ env.version }}.jar | ||
path: build/libs/*.jar | ||
|
||
# Notes on Script Hardening: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#understanding-the-risk-of-script-injections | ||
- name: Output Release Notes | ||
run: | | ||
echo "# 🚀 Tagged Release 🚀" >> $GITHUB_STEP_SUMMARY | ||
RELEASE_NOTES="$(./gradlew getChangelog --console=plain -q)" | ||
DELIMITER="$(openssl rand -hex 8)" | ||
echo "release_notes<<$DELIMITER" >> $GITHUB_ENV | ||
echo "$RELEASE_NOTES" >> $GITHUB_ENV | ||
echo "$DELIMITER" >> $GITHUB_ENV | ||
echo "$RELEASE_NOTES" >> $GITHUB_STEP_SUMMARY | ||
- name: Publish Plugin | ||
env: | ||
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }} | ||
run: ./gradlew publishPlugin | ||
|
||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: build/libs/*.jar | ||
body: ${{ env.release_notes }} | ||
draft: true | ||
|
||
- name: Commit Release Notes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: "CHANGELOG.md" | ||
message: "docs: update changelog" | ||
default_author: github_actions |