-
Notifications
You must be signed in to change notification settings - Fork 0
Include usability/volume fixes and add AUR release automation #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
aea94ca
feat: improve tui usability
OneNoted 9177ffe
fix: investigate volume reset to zero
OneNoted e38e1b6
chore: add GitHub release bundling
OneNoted 07ad5df
chore: add AUR package definitions
OneNoted 4f38c27
chore: automate AUR publishing
OneNoted 10ead7a
fix: address AUR review feedback
OneNoted 20d7c2e
fix: address CI and review follow-up
OneNoted 3189475
fix: trigger aur-git sync on srcinfo changes
OneNoted 34a800e
fix: stage all AUR package files
OneNoted File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: aur-bin | ||
|
|
||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: Version to publish without the leading v | ||
| required: true | ||
| source_url: | ||
| description: Release archive URL | ||
| required: true | ||
| sha256: | ||
| description: SHA-256 checksum for the release archive | ||
| required: true | ||
|
|
||
| jobs: | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Resolve release metadata | ||
| id: release | ||
| run: | | ||
| if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then | ||
| python - <<'PY' >> "$GITHUB_OUTPUT" | ||
| import json | ||
| import urllib.request | ||
| from pathlib import Path | ||
|
|
||
| event = json.loads(Path('${{ github.event_path }}').read_text()) | ||
| tag_name = event['release']['tag_name'] | ||
| version = tag_name.removeprefix('v') | ||
| tarball = None | ||
| checksum = None | ||
| for asset in event['release']['assets']: | ||
| name = asset['name'] | ||
| if name == f'orators-{tag_name}-x86_64-unknown-linux-gnu.tar.gz': | ||
| tarball = asset['browser_download_url'] | ||
| elif name == f'orators-{tag_name}-x86_64-unknown-linux-gnu.tar.gz.sha256': | ||
| checksum = asset['browser_download_url'] | ||
| if tarball is None or checksum is None: | ||
| raise SystemExit('release assets are missing the expected archive or checksum') | ||
| with urllib.request.urlopen(checksum) as response: | ||
| sha256 = response.read().decode().split()[0] | ||
| print(f'version={version}') | ||
| print(f'source_url={tarball}') | ||
| print(f'sha256={sha256}') | ||
| PY | ||
| else | ||
| echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT" | ||
| echo "source_url=${{ inputs.source_url }}" >> "$GITHUB_OUTPUT" | ||
| echo "sha256=${{ inputs.sha256 }}" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Prepare AUR SSH key | ||
| env: | ||
| AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | ||
| run: | | ||
| install -d -m 700 ~/.ssh | ||
| printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur | ||
| chmod 600 ~/.ssh/aur | ||
| ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts | ||
| echo 'GIT_SSH_COMMAND=ssh -i ~/.ssh/aur -o IdentitiesOnly=yes' >> "$GITHUB_ENV" | ||
|
|
||
| - name: Render orators-bin package | ||
| run: | | ||
| ./scripts/aur/render_orators_bin_pkgbuild.py \ | ||
| --version "${{ steps.release.outputs.version }}" \ | ||
| --source-url "${{ steps.release.outputs.source_url }}" \ | ||
| --sha256 "${{ steps.release.outputs.sha256 }}" \ | ||
| --output-dir /tmp/orators-bin | ||
|
|
||
| - name: Publish to AUR | ||
| env: | ||
| AUR_PACKAGER_NAME: ${{ secrets.AUR_PACKAGER_NAME }} | ||
| AUR_PACKAGER_EMAIL: ${{ secrets.AUR_PACKAGER_EMAIL }} | ||
| run: | | ||
| ./scripts/aur/publish_aur_package.sh \ | ||
| orators-bin \ | ||
| /tmp/orators-bin \ | ||
| "update: orators-bin ${{ steps.release.outputs.version }}" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: aur-git | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'packaging/aur/orators-git/**' | ||
| - 'packaging/systemd/user/oratorsd.service' | ||
| - '.github/workflows/aur-git.yml' | ||
| - 'scripts/aur/generate_srcinfo.sh' | ||
| - 'scripts/aur/publish_aur_package.sh' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Prepare AUR SSH key | ||
| env: | ||
| AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | ||
| run: | | ||
| install -d -m 700 ~/.ssh | ||
| printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur | ||
| chmod 600 ~/.ssh/aur | ||
| ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts | ||
| echo 'GIT_SSH_COMMAND=ssh -i ~/.ssh/aur -o IdentitiesOnly=yes' >> "$GITHUB_ENV" | ||
|
|
||
| - name: Stage orators-git package | ||
| run: | | ||
| rsync -a --delete packaging/aur/orators-git/ /tmp/orators-git/ | ||
|
|
||
| - name: Publish to AUR | ||
| env: | ||
| AUR_PACKAGER_NAME: ${{ secrets.AUR_PACKAGER_NAME }} | ||
| AUR_PACKAGER_EMAIL: ${{ secrets.AUR_PACKAGER_EMAIL }} | ||
| run: | | ||
| ./scripts/aur/publish_aur_package.sh \ | ||
| orators-git \ | ||
| /tmp/orators-git \ | ||
| "update: refresh orators-git packaging" | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| github-release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Verify tag matches workspace version | ||
| run: | | ||
| tag_version="${GITHUB_REF_NAME#v}" | ||
| workspace_version=$(python - <<'PY' | ||
| import json, subprocess | ||
| metadata = json.loads(subprocess.check_output([ | ||
| 'cargo', 'metadata', '--no-deps', '--format-version', '1' | ||
| ], text=True)) | ||
| for package in metadata['packages']: | ||
| if package['name'] == 'orators': | ||
| print(package['version']) | ||
| break | ||
| else: | ||
| raise SystemExit('could not resolve orators package version') | ||
| PY | ||
| ) | ||
| if [[ "$tag_version" != "$workspace_version" ]]; then | ||
| echo "Tag version $tag_version does not match workspace version $workspace_version" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Build release archive | ||
| id: bundle | ||
| run: | | ||
| archive_path=$(./scripts/release/build-release-archive.sh --version "${GITHUB_REF_NAME#v}") | ||
| echo "archive_path=$archive_path" >> "$GITHUB_OUTPUT" | ||
| echo "checksum_path=${archive_path}.sha256" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Publish GitHub release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| gh release create "$GITHUB_REF_NAME" \ | ||
| "${{ steps.bundle.outputs.archive_path }}" \ | ||
| "${{ steps.bundle.outputs.checksum_path }}" \ | ||
| --title "orators ${GITHUB_REF_NAME#v}" \ | ||
| --notes "Automated release for orators ${GITHUB_REF_NAME#v}." |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,6 @@ | |
| /result | ||
| /.direnv | ||
|
|
||
|
|
||
| __pycache__/ | ||
| *.pyc | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.