Skip to content

Add security reporting guidance (#355) #28

Add security reporting guidance (#355)

Add security reporting guidance (#355) #28

name: Release Please
on:
push:
branches:
- main
permissions:
contents: read
jobs:
release-please:
name: Run release-please
runs-on: ubuntu-x64
permissions:
id-token: write
outputs:
release_created: ${{ steps.rp.outputs.release_created }}
tag_name: ${{ steps.rp.outputs.tag_name }}
sha: ${{ steps.rp.outputs.sha }}
version: ${{ steps.rp.outputs.version }}
steps:
- id: get-github-app-token
uses: grafana/shared-workflows/actions/create-github-app-token@580590a644e82e79bb2598bdaba0be245a14dda0 # create-github-app-token/v0.2.2
with:
github_app: pyroscope-development-app
- id: rp
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5
with:
token: ${{ steps.get-github-app-token.outputs.token }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
skip-github-pull-request: >-
${{ contains(github.event.head_commit.message, 'chore(main): release') }}
publish:
name: Publish Maven artifacts
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-x64
permissions:
contents: write
id-token: write
steps:
- name: Get secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@726f1a912f45b4807774b76a6d40cbd3fb7a12c0
with:
repo_secrets: |
NEXUS_USERNAME=publishing:nexus_username
NEXUS_PASSWORD=publishing:nexus_password
NEXUS_GPG_KEY_ID=publishing:nexus_gpg_key_id
NEXUS_GPG_PASSWORD=publishing:nexus_gpg_password
NEXUS_GPG_SECRING_FILE_BASE64=publishing:nexus_gpg_secring_file
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ needs.release-please.outputs.sha }}
persist-credentials: false
- name: Set up Java 11
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '11'
distribution: 'temurin'
- name: Prepare GPG Keyring
id: prepare_gpg_keyring
run: |
mkdir -p "${{ github.workspace }}/gpg"
chmod 700 "${{ github.workspace }}/gpg"
echo "$NEXUS_GPG_SECRING_FILE_BASE64" | base64 -d > "${{ github.workspace }}/gpg/secring.gpg"
chmod 600 "${{ github.workspace }}/gpg/secring.gpg"
echo "keyring_path=${{ github.workspace }}/gpg/secring.gpg" >> $GITHUB_OUTPUT
- name: Build and Publish
env:
NEXUS_GPG_SECRING_FILE: ${{ steps.prepare_gpg_keyring.outputs.keyring_path }}
run: make publish
- name: Upload GitHub release artifacts
env:
GITHUB_TOKEN: ${{ github.token }}
TAG_NAME: ${{ needs.release-please.outputs.tag_name }}
run: |
gh release upload "$TAG_NAME" \
agent/build/libs/pyroscope.jar \
--clobber
- name: Publish GitHub release
env:
GITHUB_TOKEN: ${{ github.token }}
TAG_NAME: ${{ needs.release-please.outputs.tag_name }}
run: gh release edit "$TAG_NAME" --draft=false
- name: Remove GPG Keyring
if: always()
run: rm -rf "${{ github.workspace }}/gpg"