-
Notifications
You must be signed in to change notification settings - Fork 578
79 lines (77 loc) · 3.49 KB
/
release.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
on:
push:
branches:
- master
tags:
- '**'
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.0.x'
distribution: temurin
cache: gradle
- name: Download Eclipse
run: |
wget 'https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.6.3-201703010400/eclipse-SDK-4.6.3-linux-gtk-x86_64.tar.gz&r=1' -O eclipse-SDK-4.6.3-linux-gtk-x86_64.tar.gz
tar xzvf eclipse-SDK-4.6.3-linux-gtk-x86_64.tar.gz eclipse
echo "eclipseRoot.dir=$(pwd)/eclipse" > eclipsePlugin/local.properties
- name: Build
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$GPG_SECRET_PASSPHRASE" --output spotbugs.jks .github/workflows/spotbugs.jks.gpg
echo sonatypeUsername=eller86 >> gradle.properties
echo "sonatypePassword=${SONATYPE_PASSWORD}" >> gradle.properties
echo "keystorepass=${KEYSTORE_PASS}" >> gradle.properties
./gradlew assemble publishToSonatype closeSonatypeStagingRepository createReleaseBody --no-daemon
env:
GPG_SECRET_PASSPHRASE: ${{ secrets.GPG_SECRET_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
- name: Deploy eclipse-latest
uses: peaceiris/actions-gh-pages@v3
with:
external_repository: spotbugs/eclipse-latest
personal_token: ${{ secrets.PERSONAL_TOKEN_FOR_PAGES }}
publish_branch: gh-pages
publish_dir: ./eclipsePlugin/build/site/eclipse-daily
- name: Deploy eclipse-candidate
uses: peaceiris/actions-gh-pages@v3
if: startsWith(github.ref, 'refs/tags/')
with:
external_repository: spotbugs/eclipse-candidate
personal_token: ${{ secrets.PERSONAL_TOKEN_FOR_PAGES }}
publish_branch: gh-pages
publish_dir: ./eclipsePlugin/build/site/eclipse-candidate
- name: Deploy eclipse
uses: peaceiris/actions-gh-pages@v3
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '_RC') && !contains(github.ref, '_beta')
with:
external_repository: spotbugs/eclipse
personal_token: ${{ secrets.PERSONAL_TOKEN_FOR_PAGES }}
publish_branch: gh-pages
publish_dir: ./eclipsePlugin/build/site/eclipse
- name: Get the version
if: startsWith(github.ref, 'refs/tags/')
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Create Release
# attach zip, tgz and eclipse plugin to the GitHub Release
# https://github.com/github/hub#github-actions
# https://github.com/actions/upload-release-asset/issues/28#issuecomment-617208601
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
run: |
set -x
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
assets=("-a" "./eclipsePlugin/build/distributions/eclipsePlugin.zip")
for asset in ./spotbugs/build/distributions/*; do
assets+=("-a" "$asset")
done
bin/hub release create "${assets[@]}" -F build/release.md "${{ steps.get_version.outputs.VERSION }}"