Skip to content

Commit

Permalink
wip: correct build dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Feb 6, 2024
1 parent ecafab9 commit a5a6b35
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ jobs:
runs-on: ubuntu-latest
name: build image

needs:
- Linux-arm64

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
Expand All @@ -304,6 +307,18 @@ jobs:
with:
fetch-depth: 0

- name: Determine files to upload
id: filenames
shell: bash
run: |
HASH=$(git rev-parse --short HEAD)
COUNT=$(git rev-list --count HEAD)
VERSION=$(node -e "console.log(require('./package.json').version)")
echo "sourcename=pi-image/output-satellitepi/image.gz" >> $GITHUB_OUTPUT
echo "targetname=companion-satellite-pi-${COUNT}-${HASH}.img.gz" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}+${COUNT}-${HASH}" >> $GITHUB_OUTPUT
- name: install packer
run: |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
Expand All @@ -314,7 +329,7 @@ jobs:
run: |
cd pi-image
sudo packer init satellitepi.pkr.hcl
sudo packer build --var branch=${GITHUB_REF_NAME} satellitepi.pkr.hcl
sudo packer build --var branch=${GITHUB_REF_NAME} --var "build=${{ steps.filenames.outputs.longversion }}" satellitepi.pkr.hcl
env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -330,18 +345,6 @@ jobs:
sudo gzip -n image
- name: Determine files to upload
id: filenames
shell: bash
run: |
HASH=$(git rev-parse --short HEAD)
COUNT=$(git rev-list --count HEAD)
VERSION=$(node -e "console.log(require('./package.json').version)")
echo "sourcename=pi-image/output-satellitepi/image.gz" >> $GITHUB_OUTPUT
echo "targetname=companion-satellite-pi-${COUNT}-${HASH}.img.gz" >> $GITHUB_OUTPUT
echo "longversion=${VERSION}+${COUNT}-${HASH}" >> $GITHUB_OUTPUT
- name: Upload build
uses: bitfocus/actions/upload-and-notify@main
with:
Expand Down
5 changes: 2 additions & 3 deletions pi-image/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ git config --global pull.rebase false


# run the update script
if [ "$SATELLITE_BUILD" == "beta" ] || [ "$SATELLITE_BUILD" == "experimental" ]; then
./pi-image/update.sh beta
if [ "$SATELLITE_BRANCH" == "main" ]; then
./pi-image/update.sh beta "$SATELLITE_BUILD"
else
./pi-image/update.sh stable "$SATELLITE_BUILD"
fi
# ./pi-image/update.sh $SATELLITE_BRANCH

# install update script dependencies, as they were ignored
yarn --cwd "/usr/local/src/companion-satellite/update-prompt" install
Expand Down
6 changes: 6 additions & 0 deletions pi-image/satellitepi.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ variable "branch" {
default = "main"
}

variable "build" {
type = string
default = "beta"
}

source "arm-image" "satellitepi" {
iso_checksum = "sha256:9ce5e2c8c6c7637cd2227fdaaf0e34633e6ebedf05f1c88e00f833cbb644db4b"
iso_url = "https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz"
Expand Down Expand Up @@ -48,6 +53,7 @@ build {

# run the script
"export SATELLITE_BRANCH=${var.branch}",
"export SATELLITE_BUILD=${var.build}",
"chmod +x /tmp/install.sh",
"/tmp/install.sh"
]
Expand Down

0 comments on commit a5a6b35

Please sign in to comment.