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",
"tamasfe.even-better-toml",
"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:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
create:
branches:
- 'create_release/*'
jobs:
publish:
release:
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
override: true
- name: Login
uses: actions-rs/cargo@v1
- name: Install cargo-edit
uses: baptiste0928/cargo-install@v1
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}
crate: cargo-edit
- name: Publish qbittorrent-web-api-gen
uses: actions-rs/cargo@v1
- name: Determine version
id: vars
uses: actions/github-script@v5
with:
command: publish
args: --package qbittorrent-web-api-gen
script: |
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: Publish qbittorrent-web-api
uses: actions-rs/cargo@v1
- name: Bump version
run: cargo set-version --workspace ${{ steps.vars.outputs.result }}
- name: Commit files
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:
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')
echo "::set-output name=version::$VERSION"
- uses: Klemensas/action-autotag@stable
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
version: "${{ steps.determine-version.outputs.version }}"
tag_prefix: "v"
- name: Create and push tag
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git push origin "v${{ steps.determine-version.outputs.version }}"