Skip to content

Commit b74d8c2

Browse files
committed
Add github actions and dependabot
1 parent b8a02c5 commit b74d8c2

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
8+
- package-ecosystem: "gradle"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
name: CI
4+
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
branches: [ main ]
10+
11+
jobs:
12+
verify-gradle-wrapper:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: gradle/wrapper-validation-action@v1.0.3
17+
18+
build:
19+
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
jdk: [11, 15]
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions/cache@v2.1.4
27+
with:
28+
path: |
29+
~/.gradle/caches
30+
~/.gradle/wrapper
31+
key: ${{ runner.os }}-jdk-${{ matrix.jdk }}-gradlewrapper-${{ hashFiles('**/gradle-wrapper.properties') }}-gradlescripts-${{ hashFiles('**/*.gradle*') }}
32+
restore-keys: |
33+
${{ runner.os }}-jdk-${{ matrix.jdk }}-gradlewrapper-${{ hashFiles('**/gradle-wrapper.properties') }}-gradlescripts-
34+
- name: Set up JDK
35+
uses: actions/setup-java@v1
36+
with:
37+
java-version: ${{ matrix.jdk }}
38+
- run: chmod +x gradlew
39+
- run: ./gradlew build --stacktrace --warning-mode all
40+
41+
release:
42+
runs-on: ubuntu-latest
43+
needs: [build, verify-gradle-wrapper] # build job must pass before we can release
44+
45+
if: github.event_name == 'push'
46+
&& github.ref == 'refs/heads/main'
47+
&& github.repository == 'MinimallyCorrect/JavaTransformer'
48+
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')
49+
50+
steps:
51+
- name: Check out code
52+
uses: actions/checkout@v2
53+
with:
54+
fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci
55+
56+
- name: Set up Java 11
57+
uses: actions/setup-java@v1
58+
with:
59+
java-version: 11
60+
61+
- name: Build and publish to github
62+
run: ./gradlew -P releasing publish publishPlugins githubRelease -s
63+
env:
64+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
65+
GRADLE_PUBLISH_KEY: ${{secrets.GRADLE_PUBLISH_KEY}}
66+
GRADLE_PUBLISH_SECRET: ${{secrets.GRADLE_PUBLISH_SECRET}}
67+
DEPLOYMENT_REPO_URL_RELEASE: ${{secrets.DEPLOYMENT_REPO_URL_RELEASE}}
68+
DEPLOYMENT_REPO_URL_SNAPSHOT: ${{secrets.DEPLOYMENT_REPO_URL_SNAPSHOT}}
69+
DEPLOYMENT_REPO_USERNAME: ${{secrets.DEPLOYMENT_REPO_USERNAME}}
70+
DEPLOYMENT_REPO_PASSWORD: ${{secrets.DEPLOYMENT_REPO_PASSWORD}}

0 commit comments

Comments
 (0)