Skip to content

Commit 63fd139

Browse files
committed
Add a CI and package publishing Github actions.
1 parent 884c792 commit 63fd139

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

.github/workflows/build.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Build workflow
2+
3+
name: CI
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ master ]
10+
11+
# Allows to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
jobs:
15+
16+
# Validate wrapper to prevent potential supply chain attack
17+
gradle-wrapper-validation:
18+
runs-on: ubuntu-latest
19+
20+
name: Validate Gradle wrapper
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: gradle/wrapper-validation-action@v1
25+
26+
build:
27+
runs-on: ubuntu-latest
28+
29+
strategy:
30+
matrix:
31+
java: [ '11', '17' ]
32+
33+
name: Java ${{ matrix.Java }} build
34+
35+
steps:
36+
- uses: actions/checkout@v2
37+
38+
# Set JDK
39+
- name: Set up JDK
40+
uses: actions/setup-java@v2
41+
with:
42+
java-version: ${{ matrix.java }}
43+
distribution: 'adopt'
44+
45+
# Build
46+
- name: Build with Gradle
47+
run: ./gradlew build

.github/workflows/publish-package.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow will build a package using Gradle and then deploy it to GitHub
2+
# packages when a release is published
3+
4+
name: Github Packages
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v2
22+
with:
23+
java-version: '17'
24+
distribution: 'adopt'
25+
server-id: github
26+
settings-path: ${{ github.workspace }}
27+
28+
- name: Build with Gradle
29+
run: ./gradlew build -x test
30+
31+
- name: Publish to GitHub Packages
32+
run: ./gradlew publish -PmavenReleaseRepoUrl="https://maven.pkg.github.com/css4j/web-apis" -PmavenRepoUsername=${{ github.actor }} -PmavenRepoPassword=${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)