Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: 🎡 support publish version on protected branch #2

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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