-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: simple upload and download * chore: upload artifact name slash to dash * chore: split files by dir * chore: fix path * chore: set wd & build plugin * chore: set phase * chore: release action * chore: fix * chore: set wd to acquire version * chore: fix * chore: ready to merge
- Loading branch information
Showing
6 changed files
with
133 additions
and
59 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,115 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
env: | ||
PROJECT_NAME: gitnote | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
buildCargo: | ||
runs-on: ${{ matrix.runner }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: linux-amd64 | ||
runner: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
libName: libgitnote.so | ||
- name: win-amd64 | ||
runner: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
libName: gitnote.dll | ||
- name: macos-amd64 | ||
runner: macos-latest | ||
target: x86_64-apple-darwin | ||
libName: libgitnote.dylib | ||
- name: macos-arm64 | ||
runner: macos-latest | ||
target: aarch64-apple-darwin | ||
libName: libgitnote.dylib | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.target }} | ||
|
||
- name: Build Binary | ||
working-directory: ./gitnote-core | ||
run: cargo build --lib --verbose --locked --release --target ${{ matrix.target }} | ||
|
||
- name: Run tests | ||
working-directory: ./gitnote-core | ||
run: cargo test --lib --verbose | ||
|
||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.target }} | ||
path: ./gitnote-core/target/${{ matrix.target }}/release/${{ matrix.libName }} | ||
buildJar: | ||
runs-on: ubuntu-latest | ||
needs: buildCargo | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ./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 | ||
working-directory: ./gitnote-jetbrains | ||
run: echo "GITNOTE_VERSION=$(./gradlew properties -q | awk '/^version:/ {print $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: | ||
permissions: | ||
contents: write | ||
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 | ||
working-directory: ./gitnote-jetbrains | ||
run: echo "GITNOTE_VERSION=$(./gradlew properties -q | awk '/^version:/ {print $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 | ||
|
This file was deleted.
Oops, something went wrong.
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
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
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
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