fix aarch64 actions #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
env: | |
HOMECLI_PRINT_PROGRESS: false | |
on: | |
push: | |
branches: | |
- release* | |
tags: | |
- v* | |
- nightly | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-x86_64: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install | |
shell: bash | |
run: scripts/install.sh local-install | |
- name: Pack | |
shell: bash | |
run: scripts/pack.sh home-cli-x86_64.tar | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: home-cli-pack-x86_64 | |
path: home-cli-x86_64.tar | |
run-x86_64: | |
runs-on: ubuntu-20.04 | |
needs: build-x86_64 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/download-artifact@v3 | |
with: | |
name: home-cli-pack-x86_64 | |
- name: Unpack | |
shell: bash | |
run: scripts/install.sh unpack home-cli-x86_64.tar | |
build-arm64: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: pguyot/arm-runner-action@v2 | |
with: | |
shell: bash | |
exit_on_fail: true | |
copy_artifact_path: home-cli-arm64.tar | |
cpu: cortex-a53 # aarch64 | |
base_image: raspios_lite_arm64:latest | |
image_additional_mb: 10000 | |
commands: | | |
apt update | |
apt install -y python3 python3-pip curl fuse git | |
scripts/install.sh local-install | |
scripts/pack.sh home-cli-arm64.tar | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: home-cli-pack-arm64 | |
path: home-cli-arm64.tar | |
run-arm64: | |
runs-on: ubuntu-20.04 | |
needs: build-arm64 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/download-artifact@v3 | |
with: | |
name: home-cli-pack-arm64 | |
- uses: pguyot/arm-runner-action@v2 | |
with: | |
shell: bash | |
exit_on_fail: true | |
cpu: cortex-a53 # aarch64 | |
base_image: raspios_lite_arm64:latest | |
image_additional_mb: 10000 | |
commands: | | |
scripts/install.sh unpack home-cli-arm64.tar | |
release: | |
runs-on: ubuntu-20.04 | |
needs: | |
- run-x86_64 | |
- run-arm64 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
steps: | |
- name: Create Release | |
if: "!contains(github.ref, 'nightly')" | |
id: create_release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Delete Legacy Pre-Release | |
if: "contains(github.ref, 'nightly')" | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const { data: releases } = await github.repos.listReleases({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}); | |
for (const release of releases) { | |
if (release.prerelease) { | |
await github.repos.deleteRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: release.id, | |
}); | |
} | |
} | |
- name: Create Pre-Release | |
if: contains(github.ref, 'nightly') | |
id: create_pre_release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Pre-Release | |
draft: false | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: home-cli-pack-x86_64 | |
- name: Upload Assets x86_64 | |
if: "!contains(github.ref, 'nightly')" | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./home-cli-x86_64.tar | |
asset_name: home-cli-x86_64.tar | |
asset_content_type: application/tar | |
- name: Upload Pre-Release Assets x86_64 | |
if: contains(github.ref, 'nightly') | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_pre_release.outputs.upload_url }} | |
asset_path: ./home-cli-x86_64.tar | |
asset_name: home-cli-x86_64.tar | |
asset_content_type: application/tar | |
- uses: actions/download-artifact@v3 | |
with: | |
name: home-cli-pack-arm64 | |
- name: Upload Assets arm64 | |
if: "!contains(github.ref, 'nightly')" | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./home-cli-arm64.tar | |
asset_name: home-cli-arm64.tar | |
asset_content_type: application/tar | |
- name: Upload Pre-Release Assets arm64 | |
if: contains(github.ref, 'nightly') | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_pre_release.outputs.upload_url }} | |
asset_path: ./home-cli-arm64.tar | |
asset_name: home-cli-arm64.tar | |
asset_content_type: application/tar |