Skip to content

Add version increment v7 #11

Add version increment v7

Add version increment v7 #11

name: Build and tag Rust project
on:
push:
branches:
- master
workflow_dispatch:
jobs:
tag:
name: ${{ github.actor }} authorized build and tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate new version
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
DEFAULT_BUMP: patch
DRY_RUN: true
id: bump_version
- name: Set package version
run: |
cargo install cargo-edit
cargo set-version ${{ steps.bump_version.outputs.new_tag }}
- name: Tag
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
- name: Commit
env:
GH_TOKEN: ${{ secrets.MY_TOKEN }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git config --global user.password ${{ secrets.MY_TOKEN }}
git add .
git commit -am "chore: bump version to ${{ steps.bump_version.outputs.new_tag }}"
git push origin master --follow-tags
release:
name: release ${{ matrix.target }}
needs: tag
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile and release
uses: rust-build/rust-build.action@v1.4.4
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
EXTRA_FILES: "readme.md"