Add GitHub workflows
Change-Id: Ic4c802b336a3f7091edbcf86777baa9ea87aeede
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..34d4968
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,27 @@
+name: CI
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK 21
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '21'
+ - name: Build with Gradle
+ run: ./gradlew build --no-daemon
+ - name: Run tests
+ run: ./gradlew test --no-daemon
+ - name: Upload build artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: korapxmltool-jar
+ path: app/build/libs/*.jar
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..8c30a14
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,40 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK 21
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '21'
+ - name: Build with Gradle
+ run: ./gradlew build --no-daemon
+ - name: Get version and pre-release status
+ id: get_version
+ run: |
+ TAG_NAME=${GITHUB_REF#refs/tags/}
+ echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
+ if [[ "$TAG_NAME" =~ (alpha|beta|rc) ]]; then
+ echo "prerelease=true" >> $GITHUB_OUTPUT
+ else
+ echo "prerelease=false" >> $GITHUB_OUTPUT
+ fi
+ - name: Create Release
+ uses: softprops/action-gh-release@v2
+ with:
+ tag_name: ${{ steps.get_version.outputs.tag_name }}
+ name: Release ${{ steps.get_version.outputs.tag_name }}
+ prerelease: ${{ steps.get_version.outputs.prerelease }}
+ files: |
+ app/build/libs/*.jar
+ build/bin/*
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}