Publish Etomica modules #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Publish Etomica modules | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
name: Build, test, and package on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 14 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 14 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build and test with Gradle | |
uses: GabrielBB/xvfb-action@v1.0 | |
with: | |
run: ./gradlew build | |
- name: Build modules application | |
run: "./gradlew :etomica-modules:archiveModulesApp" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: etomica-modules-${{ runner.os }} | |
path: etomica-modules/build/dist/etomica-modules.zip | |
release: | |
name: Generate Github release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
id: download | |
- name: Get current date | |
id: get_date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Get short sha | |
id: get_sha | |
run: echo "::set-output name=sha::$(git rev-parse --short ${{ github.sha }})" | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: modules-nightly-${{ steps.get_sha.outputs.sha }}-${{ steps.get_date.outputs.date }} | |
release_name: Modules Nightly ${{ steps.get_sha.outputs.sha }}-${{ steps.get_date.outputs.date }} | |
draft: false | |
- name: Upload release asset (macOS) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./etomica-modules-macOS/etomica-modules.zip | |
asset_name: etomica-modules-macOS.zip | |
asset_content_type: application/zip | |
- name: Upload release asset (Linux) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./etomica-modules-Linux/etomica-modules.zip | |
asset_name: etomica-modules-Linux.zip | |
asset_content_type: application/zip | |
- name: Upload release asset (Windows) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./etomica-modules-Windows/etomica-modules.zip | |
asset_name: etomica-modules-Windows.zip | |
asset_content_type: application/zip | |