Manually push tag

This commit is contained in:
Joel Wachsler 2022-07-10 20:48:32 +00:00
parent 35f15d6b56
commit 91580cca28
4 changed files with 71 additions and 24 deletions

View File

@ -25,7 +25,8 @@
"rust-lang.rust-analyzer", "rust-lang.rust-analyzer",
"tamasfe.even-better-toml", "tamasfe.even-better-toml",
"serayuzgur.crates", "serayuzgur.crates",
"redhat.vscode-yaml" "redhat.vscode-yaml",
"eamodio.gitlens"
] ]
} }
}, },

34
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,34 @@
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Verify version
run: ./.github/verify_version.sh
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Login
uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish qbittorrent-web-api-gen
uses: actions-rs/cargo@v1
with:
command: publish
args: --package qbittorrent-web-api-gen
- name: Publish qbittorrent-web-api
uses: actions-rs/cargo@v1
with:
command: publish

View File

@ -1,34 +1,46 @@
on: on:
push: create:
tags: branches:
- 'v[0-9]+.[0-9]+.[0-9]+' - 'create_release/*'
jobs: jobs:
publish: release:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Verify version
run: ./.github/verify_version.sh
- name: Install latest stable - name: Install latest stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable
override: true
- name: Login - name: Install cargo-edit
uses: actions-rs/cargo@v1 uses: baptiste0928/cargo-install@v1
with: with:
command: login crate: cargo-edit
args: ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish qbittorrent-web-api-gen - name: Determine version
uses: actions-rs/cargo@v1 id: vars
uses: actions/github-script@v5
with: with:
command: publish script: |
args: --package qbittorrent-web-api-gen const { GITHUB_REF } = process.env
const version = GITHUB_REF.replace('refs/heads/create_release/', '')
console.log(`Got the following version: ${version}`)
return version
result-encoding: string
- name: Bump version
run: cargo set-version --workspace ${{ steps.vars.outputs.result }}
- name: Publish qbittorrent-web-api - name: Commit files
uses: actions-rs/cargo@v1 run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "Prepare version"
- name: Push changes
uses: ad-m/github-push-action@master
with: with:
command: publish github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

View File

@ -14,8 +14,8 @@ jobs:
VERSION=$(cat Cargo.toml | grep version | head -1 | sed 's/version = //' | sed 's/"//g') VERSION=$(cat Cargo.toml | grep version | head -1 | sed 's/version = //' | sed 's/"//g')
echo "::set-output name=version::$VERSION" echo "::set-output name=version::$VERSION"
- uses: Klemensas/action-autotag@stable - name: Create and push tag
with: run: |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" git config --local user.email "github-actions[bot]@users.noreply.github.com"
version: "${{ steps.determine-version.outputs.version }}" git config --local user.name "github-actions[bot]"
tag_prefix: "v" git push origin "v${{ steps.determine-version.outputs.version }}"