mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
125 lines
4.5 KiB
YAML
125 lines
4.5 KiB
YAML
name: Build
|
|
|
|
on:
|
|
[push]
|
|
|
|
jobs:
|
|
test:
|
|
name: Run Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up JDK 14
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 14
|
|
- uses: actions/cache@v1
|
|
with:
|
|
path: ~/.m2/repository
|
|
key: ${{ runner.os }}-maven-${{ github.run_id }}
|
|
restore-keys: |
|
|
${{ runner.os }}-maven-
|
|
- name: Build with Maven
|
|
run: mvn -B install --file main/pom.xml -Pcoverage
|
|
- name: Run Codacy Coverage Reporter
|
|
run: |
|
|
curl -o ~/codacy-coverage-reporter.jar https://repo.maven.apache.org/maven2/com/codacy/codacy-coverage-reporter/7.1.0/codacy-coverage-reporter-7.1.0-assembly.jar
|
|
$JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter.jar report -l Java -r main/commons/target/site/jacoco/jacoco.xml --partial
|
|
$JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter.jar report -l Java -r main/keychain/target/site/jacoco/jacoco.xml --partial
|
|
$JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter.jar report -l Java -r main/ui/target/site/jacoco/jacoco.xml --partial
|
|
$JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter.jar report -l Java -r main/launcher/target/site/jacoco/jacoco.xml --partial
|
|
$JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter.jar final
|
|
env:
|
|
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
|
|
|
assemble-build-kit:
|
|
name: Assemble Build Kit
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up JDK 14
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 14
|
|
- uses: actions/cache@v1
|
|
with:
|
|
path: ~/.m2/repository
|
|
key: ${{ runner.os }}-maven-${{ github.run_id }}
|
|
- name: Build with Maven
|
|
run: mvn -B package -DskipTests --file main/pom.xml --resume-from=buildkit -Prelease
|
|
- name: Upload buildkit-linux.zip
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: buildkit-linux.zip
|
|
path: main/buildkit/target/buildkit-linux.zip
|
|
- name: Upload buildkit-mac.zip
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: buildkit-mac.zip
|
|
path: main/buildkit/target/buildkit-mac.zip
|
|
- name: Upload buildkit-win.zip
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: buildkit-win.zip
|
|
path: main/buildkit/target/buildkit-win.zip
|
|
|
|
github-release:
|
|
name: Draft a Release on GitHub Releases
|
|
runs-on: ubuntu-latest
|
|
needs: assemble-build-kit
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
steps:
|
|
- name: Download buildkit-linux.zip
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: buildkit-linux.zip
|
|
path: .
|
|
- name: Download buildkit-mac.zip
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: buildkit-mac.zip
|
|
path: .
|
|
- name: Download buildkit-win.zip
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: buildkit-win.zip
|
|
path: .
|
|
- id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: ${{ github.ref }}
|
|
body: |
|
|
TODO
|
|
draft: true
|
|
prerelease: true
|
|
- name: Upload buildkit-linux.zip to GitHub Releases
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: buildkit-linux.zip
|
|
asset_name: buildkit-linux.zip
|
|
asset_content_type: application/zip
|
|
- name: Upload buildkit-mac.zip to GitHub Releases
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: buildkit-mac.zip
|
|
asset_name: buildkit-mac.zip
|
|
asset_content_type: application/zip
|
|
- name: Upload buildkit-win.zip to GitHub Releases
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: buildkit-win.zip
|
|
asset_name: buildkit-win.zip
|
|
asset_content_type: application/zip |