2020-01-28 18:06:00 +01:00
|
|
|
name: Java CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-03-20 14:45:26 +01:00
|
|
|
branches:
|
|
|
|
- master
|
2020-01-28 18:06:00 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-11-09 11:24:13 +01:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2020-11-29 04:00:03 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # This is wasteful, but needed for git describe
|
2020-01-28 18:06:00 +01:00
|
|
|
|
2020-03-23 15:43:02 +01:00
|
|
|
- name: Restore dependency cache
|
2020-11-09 11:23:35 +01:00
|
|
|
uses: actions/cache@v2.1.3
|
2020-03-23 15:43:02 +01:00
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-maven-
|
|
|
|
|
2020-01-28 18:06:00 +01:00
|
|
|
- name: Set up JDK 1.8
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 1.8
|
|
|
|
|
2020-03-23 15:43:02 +01:00
|
|
|
- name: Install genisoimage and jq
|
|
|
|
run: sudo apt-get install genisoimage jq
|
2020-01-28 18:06:00 +01:00
|
|
|
|
|
|
|
- name: Build with Maven
|
|
|
|
run: ./refine build
|
|
|
|
|
2020-03-23 15:43:02 +01:00
|
|
|
- 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"]')
|
2020-11-18 18:33:57 +01:00
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
2020-03-23 15:43:02 +01:00
|
|
|
|
2020-01-28 18:06:00 +01:00
|
|
|
- name: Generate dist files
|
|
|
|
run: ./refine dist ${{ env.OR_VERSION }}
|
|
|
|
|
|
|
|
- name: Create Release
|
2020-04-12 21:22:32 +02:00
|
|
|
if: github.repository == 'OpenRefine/OpenRefine'
|
2020-01-28 18:06:00 +01:00
|
|
|
id: create_release
|
|
|
|
run: echo ::set-env name=API_RELEASE::$(./.github/workflows/release_manager.sh)
|
|
|
|
env:
|
2020-11-18 18:33:57 +01:00
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
2020-01-28 18:06:00 +01:00
|
|
|
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
|
2020-04-12 21:22:32 +02:00
|
|
|
if: github.repository == 'OpenRefine/OpenRefine'
|
2020-10-31 20:35:16 +01:00
|
|
|
uses: actions/upload-release-asset@v1.0.2
|
2020-01-28 18:06:00 +01:00
|
|
|
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
|
2020-04-12 21:22:32 +02:00
|
|
|
if: github.repository == 'OpenRefine/OpenRefine'
|
2020-10-31 20:35:16 +01:00
|
|
|
uses: actions/upload-release-asset@v1.0.2
|
2020-01-28 18:06:00 +01:00
|
|
|
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
|
2020-04-12 21:22:32 +02:00
|
|
|
if: github.repository == 'OpenRefine/OpenRefine'
|
2020-10-31 20:35:16 +01:00
|
|
|
uses: actions/upload-release-asset@v1.0.2
|
2020-01-28 18:06:00 +01:00
|
|
|
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
|
2020-03-20 14:45:26 +01:00
|
|
|
asset_content_type: application/x-apple-diskimage
|
2020-06-16 23:26:41 +02:00
|
|
|
|
|
|
|
- name: Delete older releases
|
2020-06-18 07:56:36 +02:00
|
|
|
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:
|
2020-07-07 17:49:59 +02:00
|
|
|
repo: OpenRefine/OpenRefine-snapshot-releases
|
2020-06-20 19:25:45 +02:00
|
|
|
# Specifies number of latest releases (sorted by created_at) to keep. Pass 0 if you want to delete all releases
|
2020-06-16 23:26:41 +02:00
|
|
|
keep_latest: 10
|
2020-06-20 19:25:45 +02:00
|
|
|
# Specifies whether to delete tags associated to older releases or not.
|
|
|
|
# Older tags without any associated releases will not be deleted
|
|
|
|
delete_tags: true
|
2020-06-16 23:26:41 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_REPO_TOKEN }}
|
|
|
|
|