[WIP] Make create release action appear on github #8
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
name: Create Release | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to release in the format v0.0.0-tetrate-v0' | |
required: true | |
branch: | |
description: 'Branch to release from. Like release-v0.0.0' | |
required: true | |
## TODO delete this | |
pull_request: {} | |
jobs: | |
update-kubegres-yaml: | |
runs-on: ubuntu-latest | |
env: | |
# IMG: tetrate/kubegres:${{ github.event.inputs.version }} | |
IMG: tetrate/kubegres:v0.0.0-tetrate-v0 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# ref: ${{ github.event.inputs.branch }} | |
ref: sergicastro-patch-1 | |
# - name: Generate a token | |
# id: app_token | |
# uses: actions/create-github-app-token@v1 | |
# with: | |
# app-id: ${{ secrets.RELEASE_ACTION_APP_ID }} | |
# private-key: ${{ secrets.RELEASE_ACTION_PRIVATE_KEY }} | |
# - name: Get GitHub App User ID | |
# id: get-user-id | |
# run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
# env: | |
# GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
# - name: Configure git with App User | |
# run: | | |
# git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]' | |
# git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>' | |
- name: Update kubegres.yaml | |
run: make deploy | |
- name: Commit and push changes | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
message: "pre-release-tag: Update kubegres.yaml to version ${{ github.event.inputs.version }}" | |
# branch: ${{ github.event.inputs.branch }} | |
branch: sergicastro-patch-1 | |
rebase: true | |
- name: Create the release tag | |
uses: ncipollo/release-action@v1 | |
with: | |
# tag: ${{ github.event.inputs.version }} | |
tag: v0.0.0-tetrate-v0 | |
# - name: Create and push the new tag | |
# run: | | |
# git add kubegres.yaml config/manager/kustomization.yaml | |
# git commit -m "pre-release-tag: Update kubegres.yaml to version ${{ github.event.inputs.version }}" | |
# git push origin ${{ github.event.inputs.branch }} | |
# git tag ${{ github.event.inputs.version }} | |
# git push origin ${{ github.event.inputs.version }} |