Skip to content

Commit

Permalink
Merge pull request #13 from dhis2/reference-repo-secrets
Browse files Browse the repository at this point in the history
ci: reference repo secrets instead of environment secrets
  • Loading branch information
mortenoh committed May 9, 2022
2 parents 08175aa + 33b8860 commit 27e0eaf
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,15 @@ jobs:
distribution: 'adopt'
cache: maven
- run: mvn -B package --file pom.xml

deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: main
env:
OSSRH_USERNAME: ${{ secrets.SONATYPE_OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: maven
- run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust
mvn deploy --settings .mvn/settings.xml -Dgpg.skip=false -DskipTests=true -B
- name: Publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
OSSRH_USERNAME: ${{ secrets.SONATYPE_OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust
mvn deploy --settings .mvn/settings.xml -Dgpg.skip=false -DskipTests=true -B

0 comments on commit 27e0eaf

Please sign in to comment.