Skip to content

Commit

Permalink
chore: release action
Browse files Browse the repository at this point in the history
  • Loading branch information
cjlee38 committed Sep 22, 2024
1 parent 1fa5af4 commit 0b78014
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
48 changes: 41 additions & 7 deletions .github/workflows/rust.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Rust
name: Release

on:
push:
branches: [ "master" ]
tags:
- "v*.*.*"
pull_request:
branches: [ "master" ]

Expand All @@ -11,7 +12,7 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
buildCargo:
runs-on: ${{ matrix.runner }}

strategy:
Expand Down Expand Up @@ -56,7 +57,7 @@ jobs:
with:
name: ${{ matrix.target }}
path: ./gitnote-core/target/${{ matrix.target }}/release/${{ matrix.libName }}
collect:
buildJar:
runs-on: ubuntu-latest
needs: build

Expand All @@ -69,9 +70,42 @@ jobs:
with:
path: ./gitnote-jetbrains/src/main/resources/core

- name: list resources
run: ls -lR ./gitnote-jetbrains/src/main/resources/core/

- name: Build JAR
working-directory: ./gitnote-jetbrains
run: ./gradlew buildPlugin -Dgitnote.phase=2

- name: Get Project Version
id: get_version
run: echo "GITNOTE_VERSION=$(./gradlew properties -q | awk '/^version:/ {print "v"$2}')" >> $GITHUB_ENV

- name: Upload
uses: actions/upload-artifact@v4
with:
name: gitnote-jetbrains-${{ env.GITNOTE_VERSION }}.zip
path: ./gitnote-jetbrains/build/distributions/gitnote-jetbrains-${{ env.GITNOTE_VERSION }}.zip
release:
runs-on: ubuntu-latest
needs: [ buildCargo, buildJar ]
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
# - name: Checkout code
# uses: actions/checkout@v4

- name: Get Project Version
id: get_version
run: echo "GITNOTE_VERSION=$(./gradlew properties -q | awk '/^version:/ {print "v"$2}')" >> $GITHUB_ENV

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: gitnote-jetbrains-${{ env.GITNOTE_VERSION }}.zip

- name: list resources
run: ls -l .

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: gitnote-jetbrains/build/distributions/gitnote-jetbrains-${{ env.GITNOTE_VERSION }}.zip

2 changes: 1 addition & 1 deletion gitnote-jetbrains/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "io.cjlee"
version = "0.1.0"
version = "0.2.0"

repositories {
mavenCentral()
Expand Down

0 comments on commit 0b78014

Please sign in to comment.