-
Notifications
You must be signed in to change notification settings - Fork 34
64 lines (64 loc) · 3.17 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
name: Publish Package
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up Apache Maven Central
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- run: |
echo "Setting up secrets."
echo "$BIGQUERY_CREDENTIALS_P12" | base64 -d > src/test/resources/bigquery_credentials.p12
echo "$BIGQUERY_CREDENTIALS_PROTECTED_JSON" > src/test/resources/bigquery_credentials_protected.json
echo "$BIGQUERY_CREDENTIALS_PROTECTED_P12" | base64 -d > src/test/resources/bigquery_credentials_protected.p12
echo "$INSTALLEDACCOUNT_PROPERTIES" > src/test/resources/installedaccount.properties
echo "$INSTALLEDACCOUNT1_PROPERTIES" > src/test/resources/installedaccount1.properties
echo "$PROTECTEDACCOUNT_JSON_PROPERTIES" > src/test/resources/protectedaccount-json.properties
echo "$PROTECTEDACCOUNT_PROPERTIES" > src/test/resources/protectedaccount.properties
echo "$SERVICE_ACCOUNT_PROPERTIES" > src/test/resources/serviceaccount.properties
echo "$OAUTHACCOUNT_PROPERTIES" > src/test/resources/oauthaccount.properties
echo "Secrets loaded!"
echo "$MAVEN_PASSWORD" | sha256sum
cat ~/.m2/settings.xml
shell: bash
env:
BIGQUERY_CREDENTIALS_P12: ${{ secrets.BIGQUERY_CREDENTIALS_P12 }}
BIGQUERY_CREDENTIALS_PROTECTED_JSON: ${{ secrets.BIGQUERY_CREDENTIALS_PROTECTED_JSON }}
BIGQUERY_CREDENTIALS_PROTECTED_P12: ${{ secrets.BIGQUERY_CREDENTIALS_PROTECTED_P12 }}
INSTALLEDACCOUNT_PROPERTIES: ${{ secrets.INSTALLEDACCOUNT_PROPERTIES }}
INSTALLEDACCOUNT1_PROPERTIES: ${{ secrets.INSTALLEDACCOUNT1_PROPERTIES }}
PROTECTEDACCOUNT_JSON_PROPERTIES: ${{ secrets.PROTECTEDACCOUNT_JSON_PROPERTIES }}
PROTECTEDACCOUNT_PROPERTIES: ${{ secrets.PROTECTEDACCOUNT_PROPERTIES }}
SERVICE_ACCOUNT_PROPERTIES: ${{ secrets.SERVICE_ACCOUNT_PROPERTIES }}
OAUTHACCOUNT_PROPERTIES: ${{ secrets.OAUTHACCOUNT_PROPERTIES }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: Publish Nexus Package
run: mvn -P release -B clean deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}