From 012e2271ac3a17cab7af73cad8af126bfb09c0a1 Mon Sep 17 00:00:00 2001 From: Katerina Vankova Date: Sun, 27 Oct 2024 21:36:31 +0100 Subject: [PATCH 1/2] ci: Add automatized release --- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..83798be --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Read latest tag + run: | + TAG=$(git describe --tags --abbrev=0) + echo "Latest tag: $TAG" + echo "TAG=${TAG}" >> $GITHUB_OUTPUT + + - name: Update version in pyproject.toml + run: | + sed -i "s/^version = .*/version = \"$TAG\"/" pyproject.toml + cat pyproject.toml + + - name: Update README.md + run: | + sed -i "s/kvankova\/code-embedder@.*/kvankova\/code-embedder@$TAG/" README.md + cat README.md + + - name: Commit and push changes + run: | + git config --global user.email "action@github.com" + git config --global user.name "GitHub Action" + git add pyproject.toml README.md + git commit -m "Bump version to $TAG" + git push From 6a627637bea9b694d02efa340e10adbc708e2bba Mon Sep 17 00:00:00 2001 From: Katerina Vankova Date: Sun, 27 Oct 2024 21:39:01 +0100 Subject: [PATCH 2/2] ci: Add automatized release --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83798be..bbac31e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,8 @@ name: Release on: - workflow_dispatch: + release: + types: [published] jobs: release: