Skip to content

Commit

Permalink
Release v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Aug 31, 2024
1 parent b5ce0a2 commit 67e2972
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
contents: write
outputs:
release-id: ${{ steps.create-release.outputs.release_id }}
release-tag: ${{ steps.create-release.outputs.release_tag }}
release-flag: ${{ steps.set-release-flag.outputs.release_flag }}
pkg-name: ${{ steps.get-package-info.outputs.pkg_name }}
bin-name: ${{ steps.get-package-info.outputs.bin_name }}
Expand Down Expand Up @@ -47,7 +48,8 @@ jobs:
echo "Latest Package Version: $latest_version"
version_exists=false
for version in $(echo "$versions" | jq -r '.[]'); do
if [ "$version" == "$current_version" ]; then
trimmed=$(echo "$version" | awk '{$1=$1};1')
if [ "$trimmed" == "$current_version" ]; then
version_exists=true
break
fi
Expand All @@ -68,6 +70,7 @@ jobs:
id: create-release
run: |
release_tag="v${{ env.pkg_version }}"
echo "release_tag=v${{ env.pkg_version }}" >> "$GITHUB_OUTPUT"
cargo_prerelease=("alpha" "beta" "rc")
prerelease=false
for cargo_pre in "${cargo_prerelease[@]}"; do
Expand All @@ -78,7 +81,9 @@ jobs:
done
echo "Release Tag: $release_tag"
latest_tag=$(curl -s -L https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
commit_msg="$(git log -1 --pretty=%B | sed ':a;N;$!ba;s/\n/\\n/g')"
commit_msg+="\n**Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/$latest_tag...$release_tag"
release_data="{\"tag_name\":\"$release_tag\",\"name\":\"$release_tag\",\"body\":\"$commit_msg\",\"draft\":false,\"prerelease\":$prerelease}"
response=$(curl -X POST -H "Authorization: token ${{ secrets.GIT_TOKEN }}" \
-d "$release_data" \
Expand Down Expand Up @@ -117,7 +122,7 @@ jobs:
- release_for: macOS-arm64
os: darwin-arm64
bin: ${{ needs.release.outputs.bin-name }}
name: ${{ needs.release.outputs.pkg-name }}-Darwin-x86_64.tar.gz
name: ${{ needs.release.outputs.pkg-name }}-Darwin-arm64.tar.gz

name: Upload asset for ${{ matrix.platform.release_for }}
if: needs.release.outputs.release-flag == 'true'
Expand All @@ -126,8 +131,20 @@ jobs:
contents: write

steps:
- name: Release ID Propagation
run: |
if [ -n "${{ needs.release.outputs.release-id }}" ]; then
echo "Release ID propagated: ${{ needs.release.outputs.release-id }}"
else
echo "Release ID propagation failed. Exiting.."
exit 1
fi
echo "start_time=$(date +%s)" >> "$GITHUB_ENV"
shell: bash

- name: Checkout Repo
uses: actions/checkout@v4

- name: Update Rust
# print it with style
run: |
Expand Down Expand Up @@ -205,6 +222,16 @@ jobs:
"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ needs.release.outputs.release-id }}/assets?name=${{ matrix.platform.name }}"
shell: bash

- name: Runtime Analyzer
run: |
start=${{ env.start_time }}
end=$(date +%s)
time_taken=$((end-start))
url="${{ github.server_url }}/${{ github.repository }}/releases/download/${{ needs.release.outputs.release-tag }}/${{ matrix.platform.name }}"
hyperlink="[${{ matrix.platform.release_for }}]($url)"
echo "🚀 Built for $hyperlink in $time_taken seconds" >> $GITHUB_STEP_SUMMARY
shell: bash

publish-crate:
needs:
- release
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "RuStream"
version = "1.3.0"
version = "1.4.0"
description = "Self-hosted Streaming Engine, that can render media files via authenticated sessions."
license = "MIT"
documentation = "https://docs.rs/RuStream"
Expand Down

0 comments on commit 67e2972

Please sign in to comment.