chore: update publish pipeline #90
1 changed files with 21 additions and 15 deletions
36
.github/workflows/publish.yaml
vendored
36
.github/workflows/publish.yaml
vendored
|
|
@ -3,6 +3,8 @@ name: Publish
|
||||||
run-name: Publish by @${{ github.actor }}
|
run-name: Publish by @${{ github.actor }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v0.*'
|
- 'v0.*'
|
||||||
|
|
@ -15,7 +17,6 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
config:
|
config:
|
||||||
name: Check GoReleaser config
|
name: Check GoReleaser config
|
||||||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -28,13 +29,12 @@ jobs:
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: "Publish provider"
|
name: "Publish provider"
|
||||||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
|
||||||
needs: config
|
needs: config
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
actions: read # Required to identify workflow run.
|
actions: read # Required to identify workflow run.
|
||||||
checks: write # Required to add status summary.
|
checks: write # Required to add status summary.
|
||||||
contents: read # Required to checkout repository.
|
contents: write # Required to checkout repository.
|
||||||
pull-requests: write # Required to add PR comment.
|
pull-requests: write # Required to add PR comment.
|
||||||
steps:
|
steps:
|
||||||
- name: Install needed tools
|
- name: Install needed tools
|
||||||
|
|
@ -81,15 +81,15 @@ jobs:
|
||||||
gpg --import ~/private.key.pem
|
gpg --import ~/private.key.pem
|
||||||
rm ~/private.key.pem
|
rm ~/private.key.pem
|
||||||
|
|
||||||
- name: Run GoReleaser with SNAPSHOT
|
# - name: Run GoReleaser with SNAPSHOT
|
||||||
if: github.event_name == 'workflow_dispatch'
|
# if: github.event_name == 'workflow_dispatch'
|
||||||
id: goreleaser
|
# id: goreleaser
|
||||||
env:
|
# env:
|
||||||
GITHUB_TOKEN: ${{ env.FORGEJO_TOKEN }}
|
# GITHUB_TOKEN: ${{ env.FORGEJO_TOKEN }}
|
||||||
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
|
# GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
|
||||||
uses: goreleaser/goreleaser-action@v7
|
# uses: goreleaser/goreleaser-action@v7
|
||||||
with:
|
# with:
|
||||||
args: release --skip publish --clean --snapshot
|
# args: release --skip publish --clean --snapshot
|
||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
if: github.event_name != 'workflow_dispatch'
|
if: github.event_name != 'workflow_dispatch'
|
||||||
|
|
@ -105,9 +105,14 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.PUBLIC_KEY_PEM }}" >public_key.pem
|
echo "${{ secrets.PUBLIC_KEY_PEM }}" >public_key.pem
|
||||||
|
|
||||||
- name: Prepare provider directory structure
|
- name: Determine version
|
||||||
|
id: get_version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(jq -r .version < dist/metadata.json)
|
VERSION=$(jq -r .version < dist/metadata.json)
|
||||||
|
echo "version=${VERSIO)N}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Prepare provider directory structure
|
||||||
|
run: |
|
||||||
go run generator/main.go \
|
go run generator/main.go \
|
||||||
publish \
|
publish \
|
||||||
--namespace=mhenselin \
|
--namespace=mhenselin \
|
||||||
|
|
@ -116,7 +121,7 @@ jobs:
|
||||||
--domain=tfregistry.sysops.stackit.rocks \
|
--domain=tfregistry.sysops.stackit.rocks \
|
||||||
--gpgFingerprint="${{ secrets.GPG_FINGERPRINT }}" \
|
--gpgFingerprint="${{ secrets.GPG_FINGERPRINT }}" \
|
||||||
--gpgPubKeyFile=public_key.pem \
|
--gpgPubKeyFile=public_key.pem \
|
||||||
--version=${VERSION}
|
--version=${{ steps.get_version.outputs.version }}
|
||||||
|
|
||||||
- name: Prepare documentation nav file
|
- name: Prepare documentation nav file
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -141,6 +146,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
ssh -o StrictHostKeyChecking=no ubuntu@${{ vars.DOCS_SERVER_IP }} 'rm -rf /srv/www/docs'
|
ssh -o StrictHostKeyChecking=no ubuntu@${{ vars.DOCS_SERVER_IP }} 'rm -rf /srv/www/docs'
|
||||||
echo "${{ github.ref_name }}" >docs/_version.txt
|
echo "${{ steps.get_version.outputs.version }}" >docs/_version.txt
|
||||||
|
# echo "${{ github.ref_name }}" >docs/_version.txt
|
||||||
scp -o StrictHostKeyChecking=no -r docs ubuntu@${{ vars.DOCS_SERVER_IP }}:/srv/www/
|
scp -o StrictHostKeyChecking=no -r docs ubuntu@${{ vars.DOCS_SERVER_IP }}:/srv/www/
|
||||||
scp -o StrictHostKeyChecking=no nav.md ubuntu@${{ vars.DOCS_SERVER_IP }}:/srv/www/
|
scp -o StrictHostKeyChecking=no nav.md ubuntu@${{ vars.DOCS_SERVER_IP }}:/srv/www/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue