Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
switch to MC publishing (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddenton authored Mar 1, 2021
1 parent 543a058 commit 152df23
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 112 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# required by release-tag.sh to correctly identify files changed in the last commit
fetch-depth: 2
# required by release-tag.sh to allow pushing with another credentials so other workflows are triggered
persist-credentials: false
- uses: actions/setup-java@v1
with:
java-version: 11
Expand All @@ -23,7 +31,16 @@ jobs:
run: ./build-ci.sh
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Release (if required)
run: |
git config user.name github-actions
git config user.email [email protected]
git remote set-url origin https://x-access-token:${{ secrets.ORG_PUBLIC_REPO_RELEASE_TRIGGERING }}@github.com/${GITHUB_REPOSITORY}.git
./release-tag.sh
if: github.ref == 'refs/heads/master'
env:
GH_TOKEN: ${{ secrets.ORG_PUBLIC_REPO_RELEASE_TRIGGERING }}
31 changes: 0 additions & 31 deletions .github/workflows/release_to_bintray.yaml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/upload_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
on:
push:
tags:
- '*'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
StageMC:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Grab tag name
uses: olegtarasov/get-tag@v2
id: tagName
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11
- name: Upload to Sonatype
run: |
./gradlew publishMavenJavaPublicationToSonatypeStagingRepository \
-Psign=true \
-PreleaseVersion="${{ steps.tagName.outputs.tag }}" \
-PsigningKey="${{ secrets.SIGNING_KEY }}" \
-PsigningPassword="${{ secrets.SIGNING_PASSWORD }}" \
-PnexusUsername="${{ secrets.NEXUS_USERNAME }}" \
-PnexusPassword="${{ secrets.NEXUS_PASSWORD }}"
ReleaseMC:
needs: [StageMC]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11
- name: Release to Maven Central
run: |
./gradlew closeAndReleaseRepository \
-PnexusUsername="${{ secrets.NEXUS_USERNAME }}" \
-PnexusPassword="${{ secrets.NEXUS_PASSWORD }}"
ReleaseBintray:
needs: [ReleaseMC]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Upload to Bintray
run: ./release-ci.sh
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
Release:
needs: [ReleaseBintray]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Grab tag name
uses: olegtarasov/get-tag@v2
id: tagName
- name: Dispatch Release Event
uses: peter-evans/[email protected]
with:
token: ${{ secrets.ORG_PUBLIC_REPO_WORKFLOW_TRIGGERING }}
repository: http4k/http4k-connect
event-type: connect-release
client-payload: '{"version": "${{ steps.tagName.outputs.tag }}"}'
2 changes: 1 addition & 1 deletion build-ci.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set -o errexit
set -o pipefail
set -o nounset

./gradlew -i check jacocoRootReport --build-cache
./gradlew check jacocoRootReport --build-cache
bash <(curl -s https://codecov.io/bash)
Loading

0 comments on commit 152df23

Please sign in to comment.