From 992015c8e5ddc3f9a383a4bc0ea4748ae402a1ce Mon Sep 17 00:00:00 2001 From: hstyi Date: Thu, 16 Jan 2025 17:31:53 +0800 Subject: [PATCH] feat: GitHub actions --- .github/workflows/linux-x86-64.yml | 33 ++++++++++++++++++++++++++ .github/workflows/osx-aarch64.yml | 35 ++++++++++++++++++++++++++++ .github/workflows/osx-x86-64.yml | 34 +++++++++++++++++++++++++++ .github/workflows/windows-x86-64.yml | 29 +++++++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 .github/workflows/linux-x86-64.yml create mode 100644 .github/workflows/osx-aarch64.yml create mode 100644 .github/workflows/osx-x86-64.yml create mode 100644 .github/workflows/windows-x86-64.yml diff --git a/.github/workflows/linux-x86-64.yml b/.github/workflows/linux-x86-64.yml new file mode 100644 index 0000000..1e80596 --- /dev/null +++ b/.github/workflows/linux-x86-64.yml @@ -0,0 +1,33 @@ +name: Linux x86-64 + +on: [ push, pull_request ] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # download jdk + - run: wget -O $RUNNER_TEMP/java_package.tar.gz https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.5-linux-x64-b509.30.tar.gz + + # install jdk + - name: Installing Java + uses: actions/setup-java@v4 + with: + distribution: 'jdkfile' + jdkFile: ${{ runner.temp }}/java_package.tar.gz + java-version: '21.0.5' + architecture: x64 + + # dist + - run: | + ./gradlew dist --no-daemon + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: termora-linux-x86-64 + path: build/distributions/*.tar.gz diff --git a/.github/workflows/osx-aarch64.yml b/.github/workflows/osx-aarch64.yml new file mode 100644 index 0000000..9c706e9 --- /dev/null +++ b/.github/workflows/osx-aarch64.yml @@ -0,0 +1,35 @@ +name: macOS aarch64 + +on: [ push, pull_request ] + +jobs: + build: + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + + # download jdk + - run: wget -O $RUNNER_TEMP/java_package.tar.gz https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.5-osx-aarch64-b509.30.tar.gz + + # install jdk + - name: Installing Java + uses: actions/setup-java@v4 + with: + distribution: 'jdkfile' + jdkFile: ${{ runner.temp }}/java_package.tar.gz + java-version: '21.0.5' + architecture: aarch64 + + + # dist + - run: | + ./gradlew dist --no-daemon + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: termora-osx-aarch64 + path: build/distributions/*.dmg diff --git a/.github/workflows/osx-x86-64.yml b/.github/workflows/osx-x86-64.yml new file mode 100644 index 0000000..ff4caef --- /dev/null +++ b/.github/workflows/osx-x86-64.yml @@ -0,0 +1,34 @@ +name: macOS x86-64 + +on: [ push, pull_request ] + +jobs: + build: + runs-on: macos-13 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # download jdk + - run: wget -O $RUNNER_TEMP/java_package.tar.gz https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.5-osx-x64-b509.30.tar.gz + + # install jdk + - name: Installing Java + uses: actions/setup-java@v4 + with: + distribution: 'jdkfile' + jdkFile: ${{ runner.temp }}/java_package.tar.gz + java-version: '21.0.5' + architecture: x64 + + + # dist + - run: | + ./gradlew dist --no-daemon + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: termora-osx-x86-64 + path: build/distributions/*.dmg diff --git a/.github/workflows/windows-x86-64.yml b/.github/workflows/windows-x86-64.yml new file mode 100644 index 0000000..91a0bdb --- /dev/null +++ b/.github/workflows/windows-x86-64.yml @@ -0,0 +1,29 @@ +name: Windows x86-64 + +on: [ push, pull_request ] + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Installing Java + uses: actions/setup-java@v4 + with: + distribution: 'jetbrains' + java-version: '21' + + # dist + - run: | + .\gradlew.bat dist --no-daemon + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: termora-windows-x86-64 + path: | + build/distributions/*.zip + build/distributions/*.msi \ No newline at end of file