Skip to content

fix: try running on main #5

fix: try running on main

fix: try running on main #5

Workflow file for this run

name: Release
on:
push:
tags:
- '*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2
id: generate-github-token
with:
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v4
- name: Configure git to use the token
run: |
git remote set-url origin https://${{ steps.generate-github-token.outputs.token }}@github.com/${{ github.repository }}.git
- name: Bump version in plugin.yaml
run: |
VERSION=$(echo ${GITHUB_REF#refs/tags/})
git checkout main
sed -i "s/version:.*/version: $VERSION/" plugin.yaml
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add plugin.yaml
git commit -m "Bump version to $VERSION"
git tag -d $VERSION
git push --delete origin $VERSION
git tag $VERSION
git push origin HEAD:main --tags
env:
GH_TOKEN: '${{ steps.generate-github-token.outputs.token }}'
- uses: ncipollo/release-action@v1
name: Create GitHub Release
id: create_release
with:
tag: ${{ github.ref }}
name: ${{ github.ref }}
env:
GH_TOKEN: '${{ steps.generate-github-token.outputs.token }}'
- name: Build Docker image
run: docker build -t ghcr.io/${{ github.repository }}:${{ github.ref }} .
- name: Log in to GitHub Container Registry
run: echo ${{ secrets.GH_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
env:
GH_TOKEN: '${{ steps.generate-github-token.outputs.token }}'
- name: Push Docker image
run: docker push ghcr.io/${{ github.repository }}/yamldifftool:${{ github.ref }}