File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Publish
2+ on :
3+ push : { branches: [master] }
4+
5+ jobs :
6+ publish :
7+ name : Publish
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Checkout repository
11+ uses : actions/checkout@v3
12+ - name : Get local crate version
13+ id : local-version
14+ run : cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].version' | echo "VERSION=$(cat)" >> "${GITHUB_OUTPUT}"
15+ - name : Get crates.io crate version
16+ id : remote-version
17+ run : curl 'https://index.crates.io/co/lo/colored' | jq -r '.vers' | tail -n 1 | echo "VERSION=$(cat)" >> "${GITHUB_OUTPUT}"
18+ - name : Check if crates.io version is older than local version
19+ id : needs-update
20+ run : |
21+ if ! printf '%s\n' "${{ steps.local-version.outputs.VERSION }}" "${{ steps.remote-version.outputs.VERSION }}" | sort -V | tail -n 1 | grep -Fw "${{ steps.remote-version.outputs.VERSION }}"; then
22+ echo "UPDATE=true" >> "${GITHUB_OUTPUT}"
23+ else
24+ echo "UPDATE=false" >> "${GITHUB_OUTPUT}"
25+ fi
26+ - name : Install parse-changelog
27+ if : steps.needs-update.outputs.UPDATE == 'true'
28+ uses : taiki-e/install-action@parse-changelog
29+ - name : Create GitHub release
30+ if : steps.needs-update.outputs.UPDATE == 'true'
31+ run : gh release create "v${{ steps.local-version.outputs.VERSION }}" -n "$(parse-changelog CHANGELOG.md "${{ steps.local-version.outputs.VERSION }}")"
32+ env :
33+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
34+ - name : Publish to crates.io
35+ if : steps.needs-update.outputs.UPDATE == 'true'
36+ run : cargo publish
37+ env :
38+ CARGO_REGISTRY_TOKEN : " ${{ secrets.CARGO_REGISTRY_TOKEN }}"
Original file line number Diff line number Diff line change 1+ # 2.0.1 (July 3, 2023)
2+ - Add edition for future compatibility.
3+ - Implement custom colors that can be stored in a variable.
14
25# 2.0.0 (July 14, 2020)
36- Add support for true colours.
Original file line number Diff line number Diff line change 11[package ]
22name = " colored"
33description = " The most simple way to add colors in your terminal"
4- version = " 2.0.0 "
4+ version = " 2.0.1 "
55edition = " 2021"
66authors = [
" Thomas Wickham <[email protected] >" ]
77license = " MPL-2.0"
You can’t perform that action at this time.
0 commit comments