v0.19.0 #27
Workflow file for this run
This file contains 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
on: | |
release: | |
types: [published] | |
name: Upload Release Asset | |
jobs: | |
build: | |
name: Upload Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'modules/tests/go.mod' | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | |
- name: Publish tekton images and generate release manifests | |
run: | | |
echo ${{ secrets.QUAY_PASSWORD }} | podman login -u="${{ secrets.QUAY_BOT }}" --password-stdin quay.io | |
export RELEASE_VERSION="${{ steps.get_release.outputs.tag_name }}" | |
make release | |
- name: Upload manifest | |
id: manifest | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: manifests/kubevirt-tekton-tasks.yaml | |
asset_name: kubevirt-tekton-tasks.yaml | |
asset_content_type: text/plain | |
- name: Update tekton tasks manifests | |
run: | | |
# Define vars | |
export RELEASE_VERSION=${{ steps.get_release.outputs.tag_name }} | |
# If GITHUB_FORK_USER is changed, a new access token should be set as a repo secret (ACTIONS_TOKEN) | |
export GITHUB_FORK_USER=ksimon1 | |
# Set git configs to sign the commit | |
git config --global user.email "[email protected]" | |
git config --global user.name "Kubevirt-Tekton-tasks Release Automation" | |
# Clone the operator repo with a token to allow pushing before creating a PR | |
git clone https://${GITHUB_FORK_USER}:${{ secrets.ACTIONS_TOKEN }}@github.com/${GITHUB_FORK_USER}/kubevirt-tekton-tasks | |
# Authenticate with gh cli | |
echo ${{ secrets.ACTIONS_TOKEN }} > token.txt | |
gh auth login --with-token < token.txt | |
rm token.txt | |
cd kubevirt-tekton-tasks | |
git remote add upstream https://github.com/kubevirt/kubevirt-tekton-tasks | |
git fetch upstream | |
git checkout main | |
git rebase upstream/main | |
git checkout -b update-tekton-tasks-manifests-${RELEASE_VERSION} | |
sed -i "s/export RELEASE_VERSION.*=.*/export RELEASE_VERSION ?=${RELEASE_VERSION}/g" scripts/makefile-snippets/makefile-release.mk | |
make generate-yaml-tasks copy-released-manifests | |
git add . | |
git commit -sm "Update tekton tasks manifests to version ${RELEASE_VERSION}" | |
git push --set-upstream origin update-tekton-tasks-manifests-${RELEASE_VERSION} | |
# Create a new PR in the kubevirt-tekton-tasks repo | |
gh pr create --repo kubevirt/kubevirt-tekton-tasks \ | |
--base main \ | |
--head ${GITHUB_FORK_USER}:update-tekton-tasks-manifests-${RELEASE_VERSION} \ | |
--title "Update tekton tasks manifests to version ${RELEASE_VERSION}" \ | |
--body "$(cat << EOF | |
Update tekton tasks manifests to version ${RELEASE_VERSION} | |
**Release note**: | |
\`\`\`release-note | |
NONE | |
\`\`\` | |
EOF | |
) | |
" |