Skip to content

New Development Cycle #5

New Development Cycle

New Development Cycle #5

Workflow file for this run

name: "New Development Cycle"
on:
workflow_dispatch: # allows manual triggering
permissions:
contents: write
jobs:
master_check:
runs-on: ubuntu-latest
steps:
- name: master branch check
if: github.ref != 'refs/heads/master'
run: |
echo "You should only start a new cycle of development from the master branch."
exit 1
release_beta:
needs: master_check
uses: RibirX/rclog/.github/workflows/release-version.yml@main
with:
level: 'beta'
ref: ${{ github.ref }}
merge_changelog: true
secrets:
CRATE_RELEASE_TOKEN: ${{ secrets.CRATE_RELEASE_TOKEN }}
GITHUB_RELEASE_TOKEN: ${{ secrets.RIBIR_RELEASE }}
checkout_relase_branch:
needs: release_beta
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.RIBIR_RELEASE }}
- name: Install cargo-release
uses: taiki-e/install-action@v2
with:
tool: cargo-release
- name: Intasll semver tool
run: npm install -g semver
- name: new release branch & alpha version
run: |
git config --global user.name "RChangelog[bot]"
git config --global user.email 155627257+RChangelog[bot]@users.noreply.github.com
# need a pull, release a beta version before
git pull --rebase
version=$(git describe --tags --abbrev=0 | grep -oP '(?<=v)\S*')
version=$(semver $version -c)
branch_name=release-$(echo $version | grep -oP '[0-9]+.[0-9]+').x
git checkout -b $branch_name
git push --set-upstream origin $branch_name
# relase a empty new alpha version without tag and publish or any changelog update
git checkout master
cargo login ${{secrets.CRATE_RELEASE_TOKEN}}
new_alpha_version=$(semver $version -i minor)-alpha.0
echo "publish = false" >> /tmp/$new_alpha_version.toml
echo "tag = false" >> /tmp/$new_alpha_version.toml
echo "pre-release-replacements = []" >> /tmp/$new_alpha_version.toml
echo 'pre-release-hook = ["echo", "no replace in alpha.0"]' >> /tmp/$new_alpha_version.toml
cargo release $new_alpha_version -x --no-confirm -c /tmp/$new_alpha_version.toml