Skip to content

Commit

Permalink
hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Jan 11, 2025
1 parent ae5a2cd commit a6832db
Showing 1 changed file with 55 additions and 50 deletions.
105 changes: 55 additions & 50 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ jobs:
runs-on: ubuntu-latest
name: build image

# only run for main
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# # only run for main
# if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}

needs:
- Linux-arm64
# needs:
# - Linux-arm64

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -425,50 +425,55 @@ jobs:
path: /tmp/packer_cache
key: ${{ steps.install-packer.outputs.CACHE_KEY }}

- name: build image
run: |
echo "BUILD_IS_TAG=${BUILD_IS_TAG}"
if [[ "$BUILD_IS_TAG" == "true" ]]; then
export BUILD_BRANCH=stable
export BUILD_VERSION="${{ steps.filenames.outputs.shortversion }}"
else
export BUILD_BRANCH=${GITHUB_REF_NAME}
export BUILD_VERSION="${{ steps.filenames.outputs.longversion }}"
fi
cd pi-image
sudo packer init satellitepi.pkr.hcl
sudo packer build --var branch=${BUILD_BRANCH} --var "build=$BUILD_VERSION" satellitepi.pkr.hcl
env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKER_CACHE_DIR: /tmp/packer_cache
BUILD_IS_TAG: ${{ startsWith(github.ref, 'refs/tags/v') }}

- name: compress image
shell: bash
run: |
cd pi-image/output-satellitepi
sudo apt-get install -y zerofree
device="$(sudo losetup --partscan --show --find image)"
sudo zerofree "${device}p2"
sudo losetup --detach "$device"
sudo gzip -n image
- name: Upload build
uses: bitfocus/actions/upload-and-notify@main
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
long-version: ${{ steps.filenames.outputs.longversion }}
beta-branch: main

source-filename: ${{ steps.filenames.outputs.sourcename }}
destination-filename: ${{ steps.filenames.outputs.targetname }}
s3-host: ${{ secrets.S3_HOST }}
s3-bucket: ${{ secrets.S3_BUCKET }}/companion-satellite
s3-access-key: ${{ secrets.S3_KEY }}
s3-secret-key: ${{ secrets.S3_SECRET }}

api-product: companion-satellite
api-target: 'linux-img'
api-secret: ${{ secrets.BITFOCUS_API_PROJECT_SECRET }}
limit-access-to-actor: true

# - name: build image
# run: |
# echo "BUILD_IS_TAG=${BUILD_IS_TAG}"
# if [[ "$BUILD_IS_TAG" == "true" ]]; then
# export BUILD_BRANCH=stable
# export BUILD_VERSION="${{ steps.filenames.outputs.shortversion }}"
# else
# export BUILD_BRANCH=${GITHUB_REF_NAME}
# export BUILD_VERSION="${{ steps.filenames.outputs.longversion }}"
# fi

# cd pi-image
# sudo packer init satellitepi.pkr.hcl
# sudo packer build --var branch=${BUILD_BRANCH} --var "build=$BUILD_VERSION" satellitepi.pkr.hcl
# env:
# PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PACKER_CACHE_DIR: /tmp/packer_cache
# BUILD_IS_TAG: ${{ startsWith(github.ref, 'refs/tags/v') }}

# - name: compress image
# shell: bash
# run: |
# cd pi-image/output-satellitepi

# sudo apt-get install -y zerofree
# device="$(sudo losetup --partscan --show --find image)"
# sudo zerofree "${device}p2"
# sudo losetup --detach "$device"

# sudo gzip -n image

# - name: Upload build
# uses: bitfocus/actions/upload-and-notify@main
# with:
# long-version: ${{ steps.filenames.outputs.longversion }}
# beta-branch: main

# source-filename: ${{ steps.filenames.outputs.sourcename }}
# destination-filename: ${{ steps.filenames.outputs.targetname }}
# s3-host: ${{ secrets.S3_HOST }}
# s3-bucket: ${{ secrets.S3_BUCKET }}/companion-satellite
# s3-access-key: ${{ secrets.S3_KEY }}
# s3-secret-key: ${{ secrets.S3_SECRET }}

# api-product: companion-satellite
# api-target: 'linux-img'
# api-secret: ${{ secrets.BITFOCUS_API_PROJECT_SECRET }}

0 comments on commit a6832db

Please sign in to comment.