From b1bcbd9e8f1e5a28dc068d5be9beb918afdbb9a5 Mon Sep 17 00:00:00 2001 From: Liz Fong-Jones Date: Sun, 10 Dec 2023 22:07:05 -0500 Subject: [PATCH] maint: add release workflow (#18) * maint: add release workflow * publish before updating manifest --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..352af4b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Publish Release YAML + +on: + release: + types: + - 'created' + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: '^1.21.5' + - uses: actions/checkout@v4 + - uses: ko-build/setup-ko@v0.6 + - run: ko build + publish-release-yaml: + name: Publish Release YAML + runs-on: ubuntu-latest + needs: Publish + steps: + - uses: actions/setup-go@v5 + with: + go-version: '^1.21.5' + - uses: actions/checkout@v4 + - uses: ko-build/setup-ko@v0.6 + - name: Generate and upload release.yaml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tag=$(echo ${{ github.ref }} | cut -c11-) # get tag name without tags/refs/ prefix. + ko resolve -t ${tag} -f config/ > release.yaml + gh release upload ${tag} release.yaml