Fix GitHub action workflow to publish snapshots

This commit is contained in:
Antonin Delpeuch 2020-03-23 15:43:02 +01:00
parent 9ad3b1080f
commit ad398076a7
2 changed files with 14 additions and 15 deletions

View File

@ -13,23 +13,28 @@ jobs:
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
run: sudo apt-get install genisoimage
- name: Install jq
run: sudo apt-get install jq
- name: Get the OpenRefine version
run: echo ::set-env name=OR_VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- 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 }}

View File

@ -1,14 +1,8 @@
#!/usr/bin/env bash
OR_VERSION=${env.OR_VERSION}
RELEASE_REPO_OWNER=${env.RELEASE_REPO_OWNER}
RELEASE_REPO_TOKEN=${env.RELEASE_REPO_TOKEN}
# Build Release Message
API_JSON=$(printf '{"tag_name": "%s","target_commitish": "master","name": "%s","body": "Release of version %s","draft": false,"prerelease": false}' ${OR_VERSION} ${OR_VERSION} ${OR_VERSION} )
API_JSON=$(printf '{"tag_name": "%s","target_commitish": "master","name": "OpenRefine snapshot %s","body": "This is a snapshot of the development version of OpenRefine, made on %s.\\n\\nThis contains the latest new features and bug fixes, but might not have been tested as thoroughly as official releases.\\n\\nMake sure you [back up your workspace](https://github.com/OpenRefine/OpenRefine/wiki/Back-Up-OpenRefine-Data) to avoid data loss and report any issues found with this version on [the mailing list](https://groups.google.com/forum/#!forum/openrefine).","draft": false,"prerelease": true}' ${OR_VERSION} ${OR_VERSION} "$(date -u +"%c")" )
# Create Release
echo $( curl --silent --data "${API_JSON}" "https://api.github.com/repos/${RELEASE_REPO_OWNER}/OpenRefine-nightly-releases/releases?access_token=${RELEASE_REPO_TOKEN}" | jq -r '.upload_url' )