diff --git a/.github/workflows/update-version.yaml b/.github/workflows/update-version.yaml index 4d14dbc..d2fb4aa 100644 --- a/.github/workflows/update-version.yaml +++ b/.github/workflows/update-version.yaml @@ -16,11 +16,25 @@ jobs: run: | echo "GITHUB_REF: $GITHUB_REF" echo "tag=${GITHUB_REF##*/v}" >> $GITHUB_OUTPUT + - name: Update version run: | sed "s/^version = \".*\"/version = \"${{ steps.vars.outputs.tag }}\"/" Cargo.toml > a ; mv a Cargo.toml sed "s/\$VERSION/${{ steps.vars.outputs.tag }}/g" templates/README.md > a ; mv a README.md - - name: Commit version + - name: Initialize Git + shell: bash run: | - git config --global user.email " \ No newline at end of file + git config --global user.name "GitHub Actions" + git config --global user.email "action@github.com" + auth_header="$(git config --local --get http.https://github.com/.extraheader)" + + - name: Commit the changes + run: | + git commit -a -m "update version to ${{ steps.vars.outputs.tag }}, ready to publish v${{ steps.vars.outputs.tag }}" || true + + - name: Push branch + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ steps.vars.outputs.branch }}