v1.0.2 🌈 #11
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
name: Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Read latest tag | |
id: read_tag | |
run: | | |
TAG=$(git describe --tags --abbrev=0) | |
echo "Latest tag: $TAG" | |
echo "TAG=${TAG}" >> $GITHUB_OUTPUT | |
- name: Update version in pyproject.toml | |
env: | |
TAG: ${{ steps.read_tag.outputs.TAG }} | |
run: | | |
sed -i "s/^version = .*/version = \"$TAG\"/" pyproject.toml | |
cat pyproject.toml | |
- name: Update README.md - Github Action version | |
env: | |
TAG: ${{ steps.read_tag.outputs.TAG }} | |
run: | | |
sed -i "s/kvankova\/code-embedder@.*/kvankova\/code-embedder@$TAG/" README.md | |
cat README.md | |
- name: Update README.md - Pre-commit version | |
env: | |
TAG: ${{ steps.read_tag.outputs.TAG }} | |
run: | | |
sed -i "s/code-embedder==.*/code-embedder==$TAG/" README.md | |
sed -i "s/rev: v[0-9]\+\.[0-9]\+\.[0-9]\+/rev: $TAG/" README.md | |
cat README.md | |
- name: Commit and push changes | |
env: | |
TAG: ${{ steps.read_tag.outputs.TAG }} | |
run: | | |
git config --global user.email "action@github.com" | |
git config --global user.name "GitHub Action" | |
git checkout main | |
git add pyproject.toml README.md | |
git commit -m "Bump version to $TAG" | |
git push origin main |