Skip to content

release

release #93

Workflow file for this run

name: release
# Publishes twitter/util, twitter/scrooge, twitter/finagle, twitter/twitter-server,
# and twitter/finatra.
#
# Expects a repository dispatch event: https://developer.github.com/v3/repos/#create-a-repository-dispatch-event
# in the form of JSON data POST to /repos/twitter/dodo/dispatches:
#
# {
# "event_type": "release",
# "client_payload": {
# "phab_id": "D12345",
# "version": "17.12.0",
# "scrooge_sbt_plugin": true,
# "scrooge_maven_plugin": true,
# "dry_run": true
# }
# }
env:
JAVA_OPTS: "-Dsbt.log.noformat=true"
PGP_KEY: ${{ secrets.PGP_KEY }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_PASS: ${{ secrets.BINTRAY_PASS }}
API_USER: ${{ secrets.API_USER }}
API_KEY: ${{ secrets.API_KEY }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
defaults:
run:
shell: bash
on:
repository_dispatch:
types: [release]
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: dump/context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/[email protected]
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]
- uses: olafurpg/setup-gpg@v3
- name: setup/gpg
run: ${{ github.workspace }}/bin/gpg-init
- name: setup/maven
uses: whelk-io/maven-settings-xml-action@v14
with:
servers: '[{ "id": "sonatype-nexus-staging", "username": "${{ secrets.SONATYPE_USERNAME }}", "password": "${{ secrets.SONATYPE_PASSWORD }}" }]'
- name: setup/sbt
run: |
cp -r ${{ github.workspace }}/bin/.sbt ~/.sbt
# checkout util and release
- name: checkout/util
uses: actions/[email protected]
with:
repository: twitter/util
token: ${{ secrets.API_KEY }}
ref: release
path: util
- name: release/util
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose util
working-directory: ${{ github.workspace }}/util
# checkout scrooge and release
- name: checkout/scrooge
if: ${{ success() }}
uses: actions/[email protected]
with:
repository: twitter/scrooge
token: ${{ secrets.API_KEY }}
ref: release
path: scrooge
- name: release/scrooge
if: ${{ success() }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose scrooge
working-directory: ${{ github.workspace }}/scrooge
# scrooge-sbt-plugin
- name: release/scrooge-sbt-plugin
if: ${{ success() && github.event.client_payload.scrooge_sbt_plugin }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose scrooge-sbt-plugin
working-directory: ${{ github.workspace }}/scrooge
# scrooge-maven-plugin
- name: release/scrooge-maven-plugin
if: ${{ success() && github.event.client_payload.scrooge_maven_plugin }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose scrooge-maven-plugin
working-directory: ${{ github.workspace }}/scrooge
# checkout finagle and release
- name: checkout/finagle
if: ${{ success() }}
uses: actions/[email protected]
with:
repository: twitter/finagle
token: ${{ secrets.API_KEY }}
ref: release
path: finagle
- name: release/finagle
if: ${{ success() }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose finagle
working-directory: ${{ github.workspace }}/finagle
# checkout twitter-server and release
- name: checkout/twitter-server
if: ${{ success() }}
uses: actions/[email protected]
with:
repository: twitter/twitter-server
token: ${{ secrets.API_KEY }}
ref: release
path: twitter-server
- name: release/twitter-server
if: ${{ success() }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose twitter-server
working-directory: ${{ github.workspace }}/twitter-server
# checkout finatra and release
- name: checkout/finatra
if: ${{ success() }}
uses: actions/[email protected]
with:
repository: twitter/finatra
token: ${{ secrets.API_KEY }}
ref: release
path: finatra
- name: release/finatra
if: ${{ success() }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose finatra
working-directory: ${{ github.workspace }}/finatra
- name: slack/notification-failure
if: ${{ cancelled() || failure() }}
run: ${{ github.workspace }}/bin/slack --verbose --denote-dry-run ${{ github.event.client_payload.dry_run }} --message "🐣 Versioned release \`failed\`." --color "#DA2700"
- name: slack/notification-success
if: ${{ success() }}
run: ${{ github.workspace }}/bin/slack --verbose --denote-dry-run ${{ github.event.client_payload.dry_run }} --message "🐣 Versioned release \`successful\`." --color "#229954"