Skip to content

Commit

Permalink
fix cargo-publish job in build_and_release.yml workflow (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
waltzofpearls authored Jan 26, 2023
1 parent 1fb21ef commit ac03948
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: build and release
on:
push:
push: # run build and release only on new git tags
tags:
- "v*.*.*" # push events to matching v*.*.*, i.e. v0.1.5, v20.15.10
- "v*.*.*" # match v*.*.*, i.e. v0.1.5, v20.15.10

jobs:
build-linux:
Expand Down Expand Up @@ -75,7 +75,6 @@ jobs:

release:
needs: [ build-linux, build-macos, build-windows ]
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -110,8 +109,6 @@ jobs:
target/package/*-*.*.*-windows-x86_64-msvc.zip
target/package/*-*.*.*-x86_64-unknown-linux-musl.tar.gz
target/package/checksums.txt
README.md
LICENSE
cargo-publish:
needs: release
Expand All @@ -120,4 +117,4 @@ jobs:
- uses: actions/checkout@v3
- name: Cargo publish
if: startsWith(github.ref, 'refs/tags/')
run: make publish
run: make publish token=${{ secrets.CARGO_REGISTRY_TOKEN }}
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: ci
on: [ push, pull_request ]
on:
push: # run tests on every git push except pushing tags
tags-ignore:
- '**'
pull_request: # run tests on every pull request

jobs:
check:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ release: ## Make a new tag based on the version from Cargo.toml and push to GitH

.PHONY: publish
publish: ## Publish to crates.io
cargo publish --manifest-path dateparser/Cargo.toml
cargo publish --manifest-path dateparser/Cargo.toml --token $(token)
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@ make show-version-files
It will output something like this:

```shell
./dateparser/Cargo.toml:3:version = "0.1.8"
./dateparser/README.md:26:dateparser = "0.1.8"
./dateparser/README.md:60:dateparser = "0.1.8"
./belt/Cargo.toml:3:version = "0.1.8"
./dateparser/Cargo.toml:3:version = "0.1.5"
./dateparser/README.md:26:dateparser = "0.1.5"
./dateparser/README.md:60:dateparser = "0.1.5"
./belt/Cargo.toml:3:version = "0.1.5"
```

Next, manually update verion numbers in those listed files or automatically bump the version with
`make bump-verison`. When auto incrementing version with `make bump-version`, it will only bump the
patch version, for example, 0.1.8 will become 0.1.9.
patch version, for example, 0.1.5 will become 0.1.6.

**NOTE**: you may need to run `cargo run` to update `belt` and `dateparser` versions in `Cargo.lock`
file.
Expand Down

0 comments on commit ac03948

Please sign in to comment.