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

Adds not-release Label and Adds Needs build-and-test to Publish Job #31

Merged
merged 1 commit into from
Mar 29, 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
52 changes: 0 additions & 52 deletions .github/workflows/cargo-publish.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/rust-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,44 @@ jobs:
- name: Run tests
run: |
cargo test --verbose -- --test-threads 1

publish:
if: github.ref == 'refs/heads/main' && github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'not-release')
runs-on: ubuntu-latest
needs: build-and-test
permissions: write-all
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Config Github
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Login to Cargo Registry
run: |
cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose

- name: Cache Cargo Release
id: cache-cargo-release
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-release

- name: Install Cargo Release
if: steps.cache-cargo-release.outputs.cache-hit != 'true'
run: |
cargo install cargo-release

- name: Create Release - PATCH
run: |
cargo release patch --push-remote "https://$GITHUB_USER:[email protected]/$GITHUB_REPOSITORY" \
--no-verify \
--no-confirm \
--verbose \
--execute
Loading