Skip to content
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

CI: make alpine releases reuse open draft MRs #1113

Merged
merged 8 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 29 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
DRY_RUN: ${{ startsWith(github.event.ref, 'refs/tags/v') && '0' || '1' }}

jobs:
build-tarball:
Expand Down Expand Up @@ -181,8 +182,6 @@ jobs:
- build-tarball
- rpm
- deb
env:
DRY_RUN: ${{ startsWith(github.event.ref, 'refs/tags/v') && '0' || '1' }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -234,17 +233,10 @@ jobs:
files: releases/${{github.ref_name}}/*
generate_release_notes: true
token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }}
- name: Release to aur
run: scripts/release-aur.sh
working-directory: rtx
- name: Release aur-bin
run: scripts/release-aur-bin.sh
working-directory: rtx
bump-homebrew-formula:
runs-on: macos-latest
if: startsWith(github.event.ref, 'refs/tags/v')
timeout-minutes: 10
needs: [release]
needs: [e2e-linux]
continue-on-error: true
steps:
- name: Checkout repository
Expand All @@ -254,12 +246,37 @@ jobs:
with:
token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }}
formula: rtx
bump-aur:
runs-on: ubuntu-22.04
timeout-minutes: 30
needs: [e2e-linux]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.RTX_SSH_KEY }}
known_hosts: ${{ secrets.RTX_KNOWN_HOSTS_AUR }}
- name: Bump aur
run: ./scripts/release-aur.sh
bump-aur-bin:
runs-on: ubuntu-22.04
timeout-minutes: 30
needs: [e2e-linux]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.RTX_SSH_KEY }}
known_hosts: ${{ secrets.RTX_KNOWN_HOSTS_AUR }}
- name: Bump aur-bin
run: ./scripts/release-aur-bin.sh
bump-alpine:
runs-on: ubuntu-22.04
if: startsWith(github.event.ref, 'refs/tags/v')
container: ghcr.io/jdx/rtx:alpine
timeout-minutes: 30
needs: [release]
needs: [e2e-linux]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
16 changes: 12 additions & 4 deletions scripts/release-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ git config --global user.email [email protected]
git clone https://gitlab.alpinelinux.org/alpine/aports /home/packager/aports
cd /home/packager/aports
git config --local core.hooksPath .githooks
git remote add jdxcode "https://jdxcode:[email protected]/jdxcode/aports.git"
git checkout -mb rtx
cd community/rtx

sed -i "s/pkgver=.*/pkgver=${RTX_VERSION#v}/" APKBUILD
Expand All @@ -27,10 +29,16 @@ abuild -r
apkbuild-lint APKBUILD

git add APKBUILD
git checkout -B "rtx/${RTX_VERSION#v}"
git commit -m "community/rtx: upgrade to ${RTX_VERSION#v}"

git remote add jdxcode "https://jdxcode:[email protected]/jdxcode/aports.git"
git push -f jdxcode
#glab mr create --draft --fill --yes -H jdxcode/aports -R alpine/aports
if [ "$DRY_RUN" == 0 ]; then
git push jdxcode
fi

open_mr="$(glab mr list -R alpine/aports --author=@me)"
if [[ "$open_mr" != "Showing"* ]]; then
if [ "$DRY_RUN" == 0 ]; then
glab mr create --draft --fill --yes -H jdxcode/aports -R alpine/aports
fi
fi
#git show
6 changes: 5 additions & 1 deletion scripts/release-aur-bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ EOF

cd aur-bin
git add .SRCINFO PKGBUILD
if git diff-index --quiet HEAD --; then
echo "No changes to PKGBUILD or .SRCINFO"
exit 0
fi
git commit -m "rtx ${RTX_VERSION#v}"
if [[ "$DRY_RUN" != 1 ]]; then
if [[ "$DRY_RUN" == 0 ]]; then
git push
fi
6 changes: 5 additions & 1 deletion scripts/release-aur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ EOF

cd aur
git add .SRCINFO PKGBUILD
if git diff-index --quiet HEAD --; then
echo "No changes to PKGBUILD or .SRCINFO"
exit 0
fi
git commit -m "rtx ${RTX_VERSION#v}"
if [ "$DRY_RUN" != 1 ]; then
if [ "$DRY_RUN" == 0 ]; then
git push
fi