919c2bcd27
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci / build (pull_request) Has been cancelled
ci/woodpecker/pr/pre-commit Pipeline was successful
ci / test (pull_request) Has been cancelled
ci / pre-commit (pull_request) Has been cancelled
ci / lint (pull_request) Has been cancelled
57 lines
1.9 KiB
YAML
57 lines
1.9 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
|
|
env:
|
|
VAULT_ADDR: https://vault.service.consul:8200
|
|
ARTIFACTAPI: https://artifactapi.k8s.syd1.au.unkin.net
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: iuclabs-release
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
|
|
with:
|
|
go-version-file: go.mod
|
|
- uses: hashicorp/vault-action@892a26828f195e65540a40b4768ae4571f51ebfc # v4.0.0
|
|
with:
|
|
url: ${{ env.VAULT_ADDR }}
|
|
method: jwt
|
|
path: jwt/github/iuclabs
|
|
role: release
|
|
jwtGithubAudience: ${{ env.VAULT_ADDR }}
|
|
exportToken: true
|
|
- uses: goreleaser/goreleaser-action@a4f02ab5355a589de60d917a659ce617ed19b3de # v7.3.0
|
|
with:
|
|
distribution: goreleaser
|
|
version: v2.20.2
|
|
args: release --clean
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# fresh login: vault tokens live 15m and the build may eat most of the first one
|
|
- uses: hashicorp/vault-action@892a26828f195e65540a40b4768ae4571f51ebfc # v4.0.0
|
|
with:
|
|
url: ${{ env.VAULT_ADDR }}
|
|
method: jwt
|
|
path: jwt/github/iuclabs
|
|
role: release
|
|
jwtGithubAudience: ${{ env.VAULT_ADDR }}
|
|
secrets: |
|
|
identity/oidc/token/artifactapi-writer token | ARTIFACTAPI_TOKEN
|
|
- name: Upload linux_amd64 to artifactapi
|
|
run: |
|
|
file="terraform-provider-artifactapi_${GITHUB_REF_NAME#v}_linux_amd64.zip"
|
|
curl -sSf --cacert /etc/vault-ca/ca.crt -X PUT \
|
|
-H "Authorization: Bearer ${ARTIFACTAPI_TOKEN}" -H "Content-Type: application/zip" \
|
|
--data-binary "@dist/${file}" \
|
|
"${ARTIFACTAPI}/api/v2/remotes/terraform-unkin/files/unkin/artifactapi/${file}"
|