update keyring generation step #30
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Charts | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - feature/FAC-158_gain-more-artifacthub-recognition | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "[email protected]" | |
| - name: Import GPG key | |
| id: import_gpg | |
| uses: crazy-max/ghaction-import-gpg@v6 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Export GPG keyring for chart-releaser (GPG 2.x compatible) | |
| run: | | |
| mkdir -p gpg-keyring | |
| gpg --batch --yes --pinentry-mode loopback \ | |
| --passphrase "$GPG_PASSPHRASE" \ | |
| --export-secret-keys "${{ steps.import_gpg.outputs.keyid }}" \ | |
| > gpg-keyring/secring.gpg | |
| gpg --batch --yes \ | |
| --export "${{ steps.import_gpg.outputs.keyid }}" \ | |
| > gpg-keyring/pubring.gpg | |
| env: | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Prepare for Chart Releaser | |
| run: | | |
| echo "$GPG_PASSPHRASE" > passphrase.txt | |
| cat <<EOF > .cr.yaml | |
| sign: true | |
| key: "${{ steps.import_gpg.outputs.keyid }}" | |
| keyring: "gpg-keyring/pubring.gpg" | |
| secret-keyring: "gpg-keyring/secring.gpg" | |
| passphrase-file: "passphrase.txt" | |
| EOF | |
| env: | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Run chart-releaser | |
| uses: helm/[email protected] | |
| with: | |
| config: .cr.yaml | |
| env: | |
| CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |