Skip to content

Commit

Permalink
ci: 🎡 support publish version on protected branch
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Adoo committed Jan 8, 2024
1 parent 20388ac commit 3c267be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ jobs:
merge_changelog: ${{ github.event.inputs.level == 'patch'|| github.event.inputs.level == 'minor' || github.event.inputs.level == 'major' }}
secrets:
CRATE_RELEASE_TOKEN: ${{ secrets.CRATE_RELEASE_TOKEN }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
14 changes: 6 additions & 8 deletions .github/workflows/release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ on:
CRATE_RELEASE_TOKEN:
description: 'A token to publish the crate'
required: true


DEPLOY_KEY:
description: 'A github deploy key to push release commit to the repo'
required: true

permissions:
contents: write
Expand All @@ -47,25 +48,22 @@ jobs:
with:
ref: ${{ inputs.ref }}
fetch-depth: 0 # Required to count the commits
ssh-key: ${{secrets.DEPLOY_KEY}}
- name: Get new commits
run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '1 week' | wc -l)" >> $GITHUB_ENV
- name: Install Rust
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ inputs.toolchain }}
- name: Install cargo-release
- name: Install cargo-release & rclog
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
uses: taiki-e/install-action@v2
with:
tool: cargo-release
# fixme: remove when stable version is released
- name: Install alpha rclog
run: cargo install rclog --version "0.1.1-alpha.1"
tool: cargo-release, rclog
- name: git config
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
run: |
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git config --global user.name "RChangelog[bot]"
git config --global user.email 155627257+RChangelog[bot]@users.noreply.github.com
# todo: use cargo-release directly merge the changelog
Expand Down

0 comments on commit 3c267be

Please sign in to comment.