-
Notifications
You must be signed in to change notification settings - Fork 15
62 lines (52 loc) · 2 KB
/
push-master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# A push on master will build, test and publish Jeka on OSSRH.
# Beside it will push the built documentation on the Jeka landing page.
# If a tag is present on the last commit, Jeka will publish versioned artifacts according tag name on OSSRH public repo.
# If no tag is present, the built artifacts will be published to OSSRH snapshot repository.
# This logic is implemented within the Jeka build.
name: Java Build and Publish
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow --tag
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Restore JeKa cache
uses: actions/cache/restore@v4
with:
path: ~/.jeka/cache
key: ${{ runner.os }}
- name: Build JeKa bootstrapped with ANT
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PWD: ${{ secrets.OSSRH_PWD }}
JEKA_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY}}
JEKA_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB }}
GITHUB_BRANCH: ${{ github.ref }}
run: ant -buildfile .github/workflows/build.xml -Dbasedir=`.`
- name: Save JeKa cache
uses: actions/cache/save@v4
with:
path: ~/.jeka/cache
key: ${{ runner.os }}
- name: Deploy MkDocs
if: github.ref == 'refs/heads/master'
uses: mhausenblas/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy distrib to Release
if: github.event_name == 'create' && github.ref_type == 'tag'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dev.jeka.core/jeka-output/dev.jeka.jeka-core-distrib.zip
asset_name: distrib.zip
tag: ${{ github.ref }}
overwrite: true