-
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.
optimisations + enforce telegram max message length
- Loading branch information
Nicholas Hassan
committed
Jan 19, 2024
1 parent
b724d9d
commit 51a0805
Showing
4 changed files
with
70 additions
and
8 deletions.
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,56 @@ | ||
name: Release | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- "**/Cargo.toml" | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
release: | ||
name: "Create New Release" | ||
runs-on: "ubuntu-latest" | ||
|
||
outputs: | ||
version: ${{ steps.pkg.outputs.VERSION }} | ||
exists: ${{ steps.check_tag.outputs.EXISTS }} | ||
|
||
steps: | ||
- name: "Check out the repo" | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "Get the version number from this push" | ||
id: pkg | ||
shell: "bash" | ||
run: | | ||
VERSION=$(awk -F ' = ' '$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' Cargo.toml) | ||
echo VERSION=$VERSION >> $GITHUB_OUTPUT | ||
- name: Check if this is a new version | ||
id: check_tag | ||
shell: bash | ||
run: | | ||
output=$(curl -s https://api.github.com/repos/$GITHUB_REPOSITORY/git/ref/tags/${{ steps.pkg.outputs.VERSION }}) | ||
message=$(echo "$output" | awk -F': ' '/"message":/ { gsub(/"/, "", $2); print $2; }' | tr -d ',') | ||
echo EXISTS=$([ "$message" = "Not Found" ] && echo "false" || echo "true") >> $GITHUB_OUTPUT | ||
echo $GITHUB_OUTPUT | ||
- name: Create a release | ||
if: steps.check_tag.outputs.EXISTS == 'false' | ||
uses: ncipollo/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag: v${{ steps.pkg.outputs.VERSION }} | ||
name: v${{ steps.pkg.outputs.VERSION }} | ||
draft: false | ||
prerelease: false |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "telelog" | ||
version = "0.1.3" | ||
version = "0.1.4" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
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