Skip to content
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
35 changes: 27 additions & 8 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
uploadDiskOnly:
description: |
If enabled, will only re-build and re-upload the release disk, without
creating a new release. Uses the version of PlayOS defined in
application.nix, without verifying that it matches the git tag.
type: boolean
default: false


permissions:
contents: write
Expand Down Expand Up @@ -39,11 +49,18 @@ jobs:
- name: Make magic-nix-cache read-only by removing post-build-hook
run: sed -i '/post-build-hook = magic-nix-cache-build-hook/d' $HOME/.config/nix/nix.conf

- name: Get version from application.nix
run: |
PLAYOS_VERSION="$(nix eval --raw -f application.nix 'version')"

echo "PLAYOS_VERSION=$PLAYOS_VERSION" >> $GITHUB_ENV


- name: Validate tag
if: ${{ inputs.uploadDiskOnly != true }}
run: |
app_vsn="$(nix eval --raw -f application.nix 'version')"
if [ "$app_vsn" != "$GITHUB_REF_NAME" ]; then
echo "Git tag ($GITHUB_REF_NAME) does not match version in application.nix ($app_vsn), aborting!"
if [ "$PLAYOS_VERSION" != "$GITHUB_REF_NAME" ]; then
echo "Git tag ($GITHUB_REF_NAME) does not match version in application.nix ($PLAYOS_VERSION), aborting!"
exit 1
fi

Expand All @@ -58,23 +75,25 @@ jobs:
aws-region: eu-central-1

- name: Publish to S3
run: ./.github/workflows/upload-test-disk.sh "$GITHUB_REF_NAME"
run: ./.github/workflows/upload-test-disk.sh "$PLAYOS_VERSION"

- name: Create Release summary
run: ./.github/workflows/gen-release-summary.sh "$GITHUB_REF_NAME" > ./release-notes.md
if: ${{ inputs.uploadDiskOnly != true }}
run: ./.github/workflows/gen-release-summary.sh "$PLAYOS_VERSION" > ./release-notes.md

- name: Create Release
if: ${{ inputs.uploadDiskOnly != true }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
extra_args=""
if [[ "$GITHUB_REF_NAME" == *VALIDATION ]]; then
if [[ "$PLAYOS_VERSION" == *VALIDATION ]]; then
extra_args="--prerelease"
elif [[ "$GITHUB_REF_NAME" == *TEST ]]; then
elif [[ "$PLAYOS_VERSION" == *TEST ]]; then
extra_args="--draft"
fi

gh release create --verify-tag \
-F ./release-notes.md \
$extra_args \
"$GITHUB_REF_NAME"
"$PLAYOS_VERSION"
2 changes: 1 addition & 1 deletion installer/install-playos/install-playos.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from datetime import datetime

PARTITION_SIZE_GB_SYSTEM = 9
PARTITION_SIZE_GB_DATA = 1
PARTITION_SIZE_GB_DATA = 2

GRUB_CFG = "@grubCfg@"
GRUB_ENV = '/mnt/boot/grub/grubenv'
Expand Down
9 changes: 5 additions & 4 deletions testing/disk/release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
with pkgs;
with lib;
let
# all sizes in MiB
# NOTE: partSizes are hard-coded in install-playos, here only used for
# computing the total diskSizeMiB
partSizes = {
boot = 525; # 525 MiB (matches install-playos default)
system = 1024 * 9; # 9 GiB (install-playos default - 1GiB)
data = 400; # 400 MiB (same as testing/disk/default.nix)
boot = 525; # 525 MiB
system = 1000 * 9; # 9 GB
data = 2000; # 2000 MB
};
diskSizeMiB = 8 + partSizes."boot" + partSizes."data" + (partSizes."system" * 2) + 1;
in
Expand Down
Loading