From 6ab72f3ac9e48143e1d97bcdc113dc132863fb62 Mon Sep 17 00:00:00 2001 From: AmaseCocoa Date: Tue, 9 Jul 2024 00:03:18 +0900 Subject: [PATCH] Commit the contents as of the tag to the release branch at release time --- .github/workflows/upload.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml index 8d99dc4..75cdf25 100644 --- a/.github/workflows/upload.yml +++ b/.github/workflows/upload.yml @@ -34,6 +34,31 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Create or switch to release branch + run: | + git checkout -B release + + - name: Copy files from tag + run: | + TAG_NAME=$(git describe --tags --abbrev=0) + git checkout $TAG_NAME -- . + + - name: Commit changes + run: | + git add -A + git commit -m "Update release branch to $TAG_NAME" + + - name: Push to release branch + run: | + git push origin release --force + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Python uses: actions/setup-python@v5 with: