RandomSec/.github/workflows/maven.yml

96 lines
3.0 KiB
YAML
Raw Normal View History

name: Java CI
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Restore dependency cache
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install genisoimage and jq
run: sudo apt-get install genisoimage jq
- name: Build with Maven
run: ./refine build
- name: Get the OpenRefine snapshot version
run: echo ::set-env name=OR_VERSION::$(cat ./main/webapp/WEB-INF/classes/git.properties | jq -r '.["git.commit.id.describe"]')
- name: Generate dist files
run: ./refine dist ${{ env.OR_VERSION }}
- name: Create Release
if: github.repository == 'OpenRefine/OpenRefine'
id: create_release
run: echo ::set-env name=API_RELEASE::$(./.github/workflows/release_manager.sh)
env:
OR_VERSION: ${{ env.OR_VERSION }}
RELEASE_REPO_OWNER: OpenRefine
RELEASE_REPO_TOKEN: ${{ secrets.RELEASE_REPO_TOKEN }}
- name: Upload Release Asset Windows
id: upload-release-asset-win
if: github.repository == 'OpenRefine/OpenRefine'
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_REPO_TOKEN }}
with:
upload_url: ${{ env.API_RELEASE }}
asset_path: ./packaging/target/openrefine-win-${{ env.OR_VERSION }}.zip
asset_name: openrefine-win-${{ env.OR_VERSION }}.zip
asset_content_type: application/zip
- name: Upload Release Asset Linux
id: upload-release-asset-linux
if: github.repository == 'OpenRefine/OpenRefine'
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_REPO_TOKEN }}
with:
upload_url: ${{ env.API_RELEASE }}
asset_path: ./packaging/target/openrefine-linux-${{ env.OR_VERSION }}.tar.gz
asset_name: openrefine-linux-${{ env.OR_VERSION }}.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Release Asset Mac
id: upload-release-asset-mac
if: github.repository == 'OpenRefine/OpenRefine'
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_REPO_TOKEN }}
with:
upload_url: ${{ env.API_RELEASE }}
asset_path: ./packaging/target/openrefine-mac-${{ env.OR_VERSION }}.dmg
asset_name: openrefine-mac-${{ env.OR_VERSION }}.dmg
asset_content_type: application/x-apple-diskimage
2020-06-16 23:26:41 +02:00
- name: Delete older releases
id: delete-older-releases
if: github.repository == 'OpenRefine/OpenRefine'
2020-06-16 23:26:41 +02:00
uses: dev-drprasad/delete-older-releases@v0.1.0
with:
repo: OpenRefine/OpenRefine-nightly-releases
keep_latest: 10
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_REPO_TOKEN }}