Skip to content

Commit

Permalink
setup github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcz committed May 26, 2021
1 parent 98acddf commit f9773ad
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Java CI with Gradle and Make

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Gradle
run: make all
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: "tagged-release"

on:
push:
tags:
- "v*"

jobs:
tagged-release:
name: "Tagged Release"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Gradle
run: make all
- name: Automatic Releases
uses: marvinpinto/action-automatic-releases@v1.2.0
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
LICENSE.txt
build/libs/*.jar
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
GIT_SHA ?= $(shell git rev-parse --short=7 HEAD)
GIT_TAG := $(shell git describe --tags 2>/dev/null)

.PHONY: build
build: clean
./gradlew --console plain -Pversion=${GIT_SHA} test shadowJar
.PHONY: all
all: clean test build-jar

.PHONY: build-jar
build-jar: clean
./gradlew --console plain -Pversion=${GIT_TAG} shadowJar

.PHONY: clean
clean:
Expand Down

0 comments on commit f9773ad

Please sign in to comment.