Skip to content

Commit

Permalink
chore(release): v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed Feb 25, 2025
1 parent 4dbfc56 commit a4f4d30
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 47 deletions.
87 changes: 42 additions & 45 deletions .github/workflows/integration_delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Extract Python Version
id: get-python-version
run: |
echo "PYTHON_VERSION=$(python --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
echo "PYTHON_VERSION=$(python --version | cut -d' ' -f2)" >>$GITHUB_OUTPUT
echo "PYTHON_VERSION=$(python --version | cut -d' ' -f2)"
- name: Install uv
Expand Down Expand Up @@ -158,8 +158,10 @@ jobs:
uv venv --system-site-packages
- name: Run Tests
env:
THREADS: ${{ startsWith(matrix.runner, 'ubo-pod') && '1' || 'auto' }}
run: |
uv run --frozen poe test --verbosity=2 --make-screenshots --cov-report=xml --cov-report=html --log-level=DEBUG --log-cli-level=5 -n ${{ startsWith(matrix.runner, 'ubo-pod') && '1' || 'auto' }}
uv run --frozen poe test --verbosity=2 --make-screenshots --cov-report=xml --cov-report=html --log-level=DEBUG --log-cli-level=5 -n "$THREADS"
- name: Collect Window Screenshots
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -219,46 +221,32 @@ jobs:
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
echo "VERSION=$(uvx hatch version)" >> "$GITHUB_OUTPUT"
echo "VERSION=$(uvx hatch version)" >>"$GITHUB_OUTPUT"
echo "VERSION=$(uvx hatch version)"
echo "NAME=$(uvx hatch project metadata | jq -r .name)" >> "$GITHUB_OUTPUT"
echo "NAME=$(uvx hatch project metadata | jq -r .name)" >>"$GITHUB_OUTPUT"
echo "NAME=$(uvx hatch project metadata | jq -r .name)"
- name: Extract Version from CHANGELOG.md
run: |
FIRST_HEADER=$(sed -n '/## /s/## //p' CHANGELOG.md | head -n 1)
if [ "$FIRST_HEADER" == "Upcoming" ]; then
if [[ "${{ steps.extract-version.outputs.VERSION }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+ ]]; then
VERSION_CHANGELOG="This is a development version."
else
echo "Error: First header in CHANGELOG.md is 'Upcoming' but the version in pyproject.toml is not a development version."
exit 1
fi
else
VERSION_CHANGELOG=$(echo $FIRST_HEADER | sed 's/Version //')
if [[ "${{ steps.extract-version.outputs.VERSION }}" =~ ^$VERSION_CHANGELOG\.dev[0-9]+ ]]; then
echo "Error: Version extracted from CHANGELOG.md does not match the version in pyproject.toml"
exit 1
else
echo "Versions are consistent."
fi
fi
- name: Configure Sentry
env:
VERSION: ${{ steps.extract-version.outputs.VERSION }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_REF: ${{ github.ref }}
GITHUB_SHA: ${{ github.sha }}
run: |
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> ubo_app/.env
echo "SENTRY_DSN=$SENTRY_DSN" >>ubo_app/.env
# conditionally set it based on whether it's a tag or not using github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
if [ "${{ github.event_name }}" == "push" ] && [ "$(echo ${{ github.ref }} | grep -c 'refs/tags/v')" -eq 1 ]; then
echo "SENTRY_RELEASE=ubo-app@${{ steps.extract-version.outputs.VERSION }}" >> ubo_app/.env
if [ "$GITHUB_EVENT_NAME" == "push" ] && [ "$(echo $GITHUB_REF | grep -c 'refs/tags/v')" -eq 1 ]; then
echo "SENTRY_RELEASE=ubo-app@$VERSION" >>ubo_app/.env
else
echo "SENTRY_RELEASE=ubo-app@${{ github.sha }}" >> ubo_app/.env
echo "SENTRY_RELEASE=ubo-app@$GITHUB_SHA" >>ubo_app/.env
fi
cat ubo_app/.env
- name: Build
run:
SETUPTOOLS_SCM_PRETEND_VERSION=${{
steps.extract-version.outputs.VERSION }} uv build
env:
VERSION: ${{ steps.extract-version.outputs.VERSION }}
run: SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION uv build

- name: Upload wheel
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -292,8 +280,6 @@ jobs:
matrix:
suffix: ['lite', '']
steps:
- run: echo Building amd64-${{ matrix.suffix }} image

- name: Checkout
uses: actions/checkout@v4

Expand All @@ -309,24 +295,32 @@ jobs:

- name: Generate Image URL and Checksum
id: generate-image-url
env:
MATRIX_SUFFIX: ${{ matrix.suffix }}
run: |
SUFFIX=""
if [ -n "${{ matrix.suffix }}" ]; then
SUFFIX="_${{ matrix.suffix }}"
if [ -n "$MATRIX_SUFFIX" ]; then
SUFFIX="_$MATRIX_SUFFIX"
fi
DASHED_SUFFIX=$(echo $SUFFIX | sed 's/_/-/g')
IMAGE_DATE='2024-11-19'
IMAGE_NAME="${IMAGE_DATE}-raspios-bookworm-arm64${DASHED_SUFFIX}"
IMAGE_URL="https://downloads.raspberrypi.com/raspios${SUFFIX}_arm64/images/raspios${SUFFIX}_arm64-${IMAGE_DATE}/${IMAGE_NAME}.img.xz"
CHECKSUM_URL="${IMAGE_URL}.sha256"
echo "suffix=$SUFFIX" >> "$GITHUB_OUTPUT"
echo "dashed_suffix=$DASHED_SUFFIX" >> "$GITHUB_OUTPUT"
echo "image_url=$IMAGE_URL" >> "$GITHUB_OUTPUT"
echo "image_name=$IMAGE_NAME" >> "$GITHUB_OUTPUT"
echo "image_checksum_url=$CHECKSUM_URL" >> "$GITHUB_OUTPUT"
IMAGE_SIZE_GB=${{ matrix.suffix == 'lite' && '4.5' || matrix.suffix == '' && '6.75' || '13' }}
echo "suffix=$SUFFIX" >>"$GITHUB_OUTPUT"
echo "dashed_suffix=$DASHED_SUFFIX" >>"$GITHUB_OUTPUT"
echo "image_url=$IMAGE_URL" >>"$GITHUB_OUTPUT"
echo "image_name=$IMAGE_NAME" >>"$GITHUB_OUTPUT"
echo "image_checksum_url=$CHECKSUM_URL" >>"$GITHUB_OUTPUT"
if $MATRIX_SUFFIX == 'lite'; then
IMAGE_SIZE_GB=4.5
elif $MATRIX_SUFFIX == ''; then
IMAGE_SIZE_GB=6.75
else
IMAGE_SIZE_GB=13
fi
IMAGE_SIZE=$(awk -v IMAGE_SIZE_GB=$IMAGE_SIZE_GB 'BEGIN {printf "%.0f", IMAGE_SIZE_GB * 1024 ^ 3}')
echo "image_size=$IMAGE_SIZE" >> "$GITHUB_OUTPUT"
echo "image_size=$IMAGE_SIZE" >>"$GITHUB_OUTPUT"
- name: Build Artifact
env:
Expand Down Expand Up @@ -354,8 +348,11 @@ jobs:
losetup -d $LOOP_DEV
- name: Compress File with Gzip
env:
VERSION: ${{ needs.build.outputs.version }}
DASHED_SUFFIX: ${{ steps.generate-image-url.outputs.dashed_suffix }}
run: |
scripts/consume.sh /build/image.img | gzip -9 > /ubo_app-${{ needs.build.outputs.version }}-bookworm${{ steps.generate-image-url.outputs.dashed_suffix }}.img.gz
scripts/consume.sh /build/image.img | gzip -9 >/ubo_app-$VERSION-bookworm$DASHED_SUFFIX.img.gz
- name: Upload Image
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -470,12 +467,12 @@ jobs:
- name: Extract Changelog
id: changelog
run: |
perl -0777 -ne 'while (/## Version ${{ needs.build.outputs.version }}\n(\s*\n)*(.*?)(\s*\n)*## Version \d+\.\d+\.\d+\n/sg) {print "$2\n"}' CHANGELOG.md > CURRENT_CHANGELOG.md
perl -0777 -ne 'while (/## Version ${{ needs.build.outputs.version }}\n(\s*\n)*(.*?)(\s*\n)*## Version \d+\.\d+\.\d+\n/sg) {print "$2\n"}' CHANGELOG.md >CURRENT_CHANGELOG.md
{
echo "CONTENT<<EOF"
cat CURRENT_CHANGELOG.md
echo "EOF"
} >> "$GITHUB_OUTPUT"
} >>"$GITHUB_OUTPUT"
- name: Release
uses: softprops/action-gh-release@v2
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Upcoming
## Version 1.2.1

- fix: tenacity is now a production dependency

Expand Down Expand Up @@ -31,7 +31,7 @@
- feat(web-ui): add `ubo-redirect-server` service
- refactor(web-ui): add notifications for when starting/stopping the hotspot fails in the system manager
- refactor(web-ui): move starting/stopping of the required hotspot system services to the `ubo-hotspot` service (the more general version of the `ubo-redirect-server` service which runs the redirect server as its main process.)
- fix(core): uninstall RPi.GPIO after installing python packages in `install.sh` related: <https://github.com/adafruit/Adafruit_Blinka/issues/910> - closes #231
- fix(core): uninstall RPi.GPIO after installing python packages in `install.sh` [related](https://github.com/adafruit/Adafruit_Blinka/issues/910) - closes #231
- fix(web-ui): avoid web-ui stop procedure being triggered when qr-code input is cancelled
- fix(system): run `time.sleep` for both branches of the ping loop (success and failure) to avoid high cpu usage of the system process
- fix(camera): avoid values read from qrcode being overridden by `None` values of alternative patterns - closes #230
Expand Down

0 comments on commit a4f4d30

Please sign in to comment.