generated from PlexSheep/rs-base
Compare commits
No commits in common. "fd164fc97861a8f9355016928abdeeb054cbea7a" and "2c5ebf25a38b850456746718244fbbdf186ece6c" have entirely different histories.
fd164fc978
...
2c5ebf25a3
5 changed files with 38 additions and 70 deletions
7
.github/dependabot.yaml
vendored
7
.github/dependabot.yaml
vendored
|
@ -1,7 +0,0 @@
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
# Check for updates every Monday
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
12
.github/workflows/cargo.yaml
vendored
12
.github/workflows/cargo.yaml
vendored
|
@ -1,16 +1,10 @@
|
||||||
name: Rust CI
|
name: cargo devel CI
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- '**'
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- '**'
|
||||||
# - '!master'
|
# - '!master'
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
CI:
|
CI:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -44,10 +38,10 @@ jobs:
|
||||||
- name: cargo fmt
|
- name: cargo fmt
|
||||||
run: cargo fmt --all
|
run: cargo fmt --all
|
||||||
- name: cargo test
|
- name: cargo test
|
||||||
run: cargo test --all-features --all-targets --workspace
|
run: cargo test --all-features --all-targets --workspace && cargo test --all-features --workspace --doc
|
||||||
- name: commit back to repository
|
- name: commit back to repository
|
||||||
uses: stefanzweifel/git-auto-commit-action@v5
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
# Optional. Commit message for the created commit.
|
# Optional. Commit message for the created commit.
|
||||||
# Defaults to "Apply automatic changes"
|
# Defaults to "Apply automatic changes"
|
||||||
commit_message: "ci: automatic Rust CI changes"
|
commit_message: automatic cargo CI changes
|
||||||
|
|
54
.github/workflows/release.yaml
vendored
54
.github/workflows/release.yaml
vendored
|
@ -1,54 +0,0 @@
|
||||||
name: Release-plz
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
# Release unpublished packages.
|
|
||||||
release-plz-release:
|
|
||||||
name: Release-plz release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Run release-plz
|
|
||||||
uses: MarcoIeni/release-plz-action@v0.5
|
|
||||||
with:
|
|
||||||
command: release
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
# Create a PR with the new versions and changelog, preparing the next release.
|
|
||||||
release-plz-pr:
|
|
||||||
name: Release-plz PR
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
concurrency:
|
|
||||||
group: release-plz-${{ github.ref }}
|
|
||||||
cancel-in-progress: false
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Run release-plz
|
|
||||||
uses: MarcoIeni/release-plz-action@v0.5
|
|
||||||
with:
|
|
||||||
command: release-pr
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
11
scripts/publish.sh
Executable file
11
scripts/publish.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
cargo check --all-features
|
||||||
|
echo ">>>>>>>> PUBLISHING RELEASE FOR REPO"
|
||||||
|
bash scripts/release.sh
|
||||||
|
echo ">>>>>>>> PUBLISHING TO CRATES.IO NEXT"
|
||||||
|
sleep 2
|
||||||
|
cargo publish
|
||||||
|
echo ">>>>>>>> PUBLISHING TO CSCHERR.DE NEXT"
|
||||||
|
sleep 2
|
||||||
|
cargo publish --registry cscherr
|
24
scripts/release.sh
Executable file
24
scripts/release.sh
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
TOKEN=$(cat ~/.git-credentials | grep 'git.cscherr.de' | grep -P '(?:)[^:]*(?=@)' -o)
|
||||||
|
NEW_VERSION=$(cat Cargo.toml | rg '^\s*version\s*=\s*"([^"]*)"\s*$' -or '$1')
|
||||||
|
GIT_COMMIT_SHA=$(git rev-parse HEAD)
|
||||||
|
REPO=${PWD##*/} # name of cwd
|
||||||
|
BODY="
|
||||||
|
$(git log $(git describe --tags --abbrev=0)..HEAD --pretty="- %s" --oneline --decorate)
|
||||||
|
"
|
||||||
|
USER=PlexSheep
|
||||||
|
git tag "v$NEW_VERSION" || echo "could not tag"
|
||||||
|
curl -X 'POST' \
|
||||||
|
'https://git.cscherr.de/api/v1/repos/PlexSheep/'$REPO'/releases' \
|
||||||
|
-H 'accept: application/json' \
|
||||||
|
-H "Authorization: token $TOKEN" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{
|
||||||
|
"body": "'"$BODY"'",
|
||||||
|
"draft": false,
|
||||||
|
"name": "v'$NEW_VERSION'",
|
||||||
|
"prerelease": true,
|
||||||
|
"tag_name": "v'$NEW_VERSION'",
|
||||||
|
"target_commitish": "'$GIT_COMMIT_SHA'"
|
||||||
|
}' | python -m json.tool
|
||||||
|
git push || echo "could not push"
|
Loading…
Add table
Reference in a new issue