Release rayhunter #8
This file contains hidden or 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
# To use: navigate on Github to Actions, select "Release rayhunter" on the left, click "Run workflow" > "Run workflow" on the right. | |
# https://github.com/EFForg/rayhunter/actions/workflows/release.yml | |
name: Release rayhunter | |
on: | |
workflow_dispatch: | |
env: | |
GH_TOKEN: ${{ github.token }} | |
jobs: | |
check_version_same: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Ensure all Cargo.toml files have the same version defined. | |
run: | | |
defined_versions=$(find lib check daemon installer rootshell telcom-parser -name Cargo.toml -exec grep ^version {} \; | sort -u | wc -l) | |
find lib check daemon installer rootshell telcom-parser -name Cargo.toml -exec grep ^version {} \; | |
echo number of defined versions = $defined_versions | |
if [ $defined_versions != "1" ] | |
then | |
echo "all Cargo.toml files must have the same version defined" | |
exit 1 | |
fi | |
main: | |
needs: check_version_same | |
permissions: | |
contents: write | |
id-token: write | |
packages: write | |
pages: write | |
uses: ./.github/workflows/main.yml | |
release: | |
runs-on: ubuntu-latest | |
needs: main | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- name: Create release | |
run: | | |
version=$(grep ^version lib/Cargo.toml | cut -d' ' -f3 | tr -d '"') | |
gh release create --generate-notes -t "Rayhunter v$version" "v$version" rayhunter-v${version}-*/rayhunter-v${version}*.zi* |