-
Notifications
You must be signed in to change notification settings - Fork 106
73 lines (60 loc) · 2.56 KB
/
build.yaml
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
63
64
65
66
67
68
69
70
71
72
73
name: build
on:
pull_request:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/gradle-build-action@v2
- run: ./gradlew build
- uses: actions/upload-artifact@v3
with:
name: diffuse-latest-binary.jar
path: diffuse/build/libs/diffuse-*-binary.jar
if-no-files-found: error
#- run: ./gradlew uploadArchives
# if: ${{ github.ref == 'refs/heads/trunk' && github.repository == 'JakeWharton/diffuse' }}
# env:
# ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
# ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
- name: Extract release notes
id: release_notes
if: startsWith(github.ref, 'refs/tags/')
uses: ffurrer2/extract-release-notes@v1
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.release_notes.outputs.release_notes }}
files: diffuse/build/libs/diffuse-*-binary.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get version
id: get_version
if: startsWith(github.ref, 'refs/tags/')
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
- name: Set SHA
id: shasum
if: startsWith(github.ref, 'refs/tags/')
run: echo ::set-output name=sha::"$(shasum -a 256 diffuse/build/libs/diffuse-*-binary.jar | awk '{printf $1}')"
- name: Bump Brew
if: startsWith(github.ref, 'refs/tags/')
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GH_HOMEBREW_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
# Update to ensure we have the latest version which supports arbitrary default branches.
brew update
brew tap JakeWharton/repo
brew bump-formula-pr -f --version=${{ steps.get_version.outputs.version }} --no-browse --no-audit \
--sha256=${{ steps.shasum.outputs.sha }} \
--url="https://github.com/JakeWharton/diffuse/releases/download/${{ steps.get_version.outputs.version }}/diffuse-${{ steps.get_version.outputs.version }}-binary.jar" \
JakeWharton/repo/diffuse