Skip to content

cd: Try github action bot config from checkout action readme #8

cd: Try github action bot config from checkout action readme

cd: Try github action bot config from checkout action readme #8

Workflow file for this run

name: Release on Tag
on:
push:
tags:
- 'v*.*.*'
env:
VERSION:
permissions:
contents: write
actions: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout triggering tag
uses: actions/checkout@v4
- name: Setup Git
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
- name: Release and Upload Asset
uses: softprops/action-gh-release@v2
with:
files: 42free.sh
generate_release_notes: true
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Get the version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV"
- name: Update version number in script
run: |
version=${{ env.VERSION }}
major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f2)
patch=$(echo $version | cut -d. -f3)
patch=$((patch + 1))
new_version="$major.$minor.$patch"
sed -i "s/^current_version=.*/current_version=\"$new_version\"/" 42free.sh
git add 42free.sh
git commit -m "bot: Update version number to $new_version"
git push origin main