RandomSec/.github/workflows/snapshot_release.yml
Antonin Delpeuch 3e955b3f73
Migrate from Travis to GitHub Actions (#3378)
* Only keep JRE 8 and 14 in the build matrix.

For #3377.

* Run tests in GitHub Actions on each PR

* Attempt to fix Postgres configuration

* Set explicit password for Postgres on GitHub Actions

* Set explicit password for MySQL and MariaDB

* Fix credentials for postgres and mysql

* Fix duplicate id in GitHub workflow

* Fix creation of test_db on MySQL

* Revert back to GH Action MySQL service

* Populate initial test databases

* Fix syntax of workflow file

* Reorder steps to give more time for MySQL to boot

* Run MySQL database as a service, forward ports to config

* Reformat MySQL options

* Fix YAML syntax

* Add missing 'steps' field

* Fix connection to MySQL and Postgres

* Add back explicit database creation steps

* Force TCP/IP connection for postgres

* Remove explicit creation of test database for postgres

* Fix Postgres and Mariadb configs

* Fix parameter spelling for mariadb

* Display MariaDB test configuration

* Fix more inconsistent parameter names

* Fix more inconsistent parameter names

* Attempt to use Coveralls maven plugin instead of GH action

* Fix workflow file

* Enable submission to coveralls

* Supply coveralls token

* Remove Travis-specific configuration files

* Also update appveyor script after rename of SQL files

* Reintroduce packaging/test_pom.xml used by Appveyor

* Update filenames in appveyor.yml
2020-12-04 08:50:10 +01:00

105 lines
3.5 KiB
YAML

name: Snapshot release
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0 # This is wasteful, but needed for git describe
- name: Restore dependency cache
uses: actions/cache@v2.1.3
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 and test with Maven
run: ./refine test
- 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"]')
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- 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:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
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.2
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.2
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.2
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
- name: Delete older releases
id: delete-older-releases
if: github.repository == 'OpenRefine/OpenRefine'
uses: dev-drprasad/delete-older-releases@v0.1.0
with:
repo: OpenRefine/OpenRefine-snapshot-releases
# Specifies number of latest releases (sorted by created_at) to keep. Pass 0 if you want to delete all releases
keep_latest: 10
# Specifies whether to delete tags associated to older releases or not.
# Older tags without any associated releases will not be deleted
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_REPO_TOKEN }}