-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @djandries @remusao |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Update Crate | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 1 */3 *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-crate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run generate script | ||
run: | | ||
chmod +x ./generate.sh | ||
./generate.sh | ||
- name: Check for changes | ||
id: git-check | ||
run: | | ||
git diff --exit-code --stat || echo "changes=true" >> $GITHUB_OUTPUT | ||
- name: Bump Cargo.toml minor version | ||
if: steps.git-check.outputs.changes == 'true' | ||
run: | | ||
# Read current version | ||
current_version=$(grep -m1 'version =' Cargo.toml | sed 's/.*= "//' | sed 's/"//') | ||
# Split version into major, minor, patch | ||
IFS='.' read -r major minor patch <<< "$current_version" | ||
# Increment minor version | ||
new_minor=$((minor + 1)) | ||
new_version="$major.$new_minor.0" | ||
# Update Cargo.toml | ||
sed -i "s/^version = \".*\"/version = \"$new_version\"/" Cargo.toml | ||
echo "Version bumped from $current_version to $new_version" | ||
- name: Create Pull Request | ||
if: steps.git-check.outputs.changes == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
git add . | ||
git commit -m "Update crate and bump version" | ||
git push --force origin HEAD:update-crate | ||
gh pr create --title "Update crate" --body "This PR updates the crate and bumps the minor version." --base master --head update-crate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters