Skip to content

Commit

Permalink
Improve github workflows & delete travis
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentC35 committed Jun 4, 2021
1 parent 6da421b commit 67ca489
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 15 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build and upload Release
name: Build and upload Release

on:
push:
tags:
- '*.*.*'
branches:
- 'master'

jobs:
build-release:
Expand All @@ -19,15 +19,18 @@ jobs:

- name: Build and test with Maven
run: mvn install -Djar.finalName="lunatic-model" -B -V --file pom.xml
- name: Get current version
id: version
run: echo "::set-output name=prop::$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)"

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: "Release ${{ github.ref }}"
tag_name: ${{steps.version.outputs.prop}}
release_name: "Release ${{steps.version.outputs.prop}}"
draft: false
prerelease: false

Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/develop-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and upload Release Candidate

on:
push:
branches:
- 'develop'

jobs:
build-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Build and test with Maven
run: mvn install -Djar.finalName="lunatic-model" -B -V --file pom.xml
- name: Get current version
id: version
run: echo "::set-output name=prop::$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)"

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.version.outputs.prop}}-rc
release_name: "Release Candidate ${{steps.version.outputs.prop}}"
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/lunatic-model.jar
asset_name: lunatic-model.jar
asset_content_type: application/java-archive
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Test on PR

on: pull_request

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Test with Maven
run: mvn test -B --file pom.xml
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

0 comments on commit 67ca489

Please sign in to comment.