Skip to content

Update build.sh

Update build.sh #2

Workflow file for this run

name: AARCH64
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
check_update:
name: Check update
runs-on: ubuntu-latest
steps:
- name: Check version
id: check_version
run: |
local_version=$(curl -L --header 'authorization: Bearer ${{ github.token }}' https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
remote_version=$(curl -L https://api.github.com/repos/Moe-sushi/xz-static/releases/latest | jq -r .tag_name)
echo local_version=$local_version | tee -a $GITHUB_OUTPUT
echo remote_version=$remote_version | tee -a $GITHUB_OUTPUT
outputs:
local_version: ${{ steps.check_version.outputs.local_version }}
remote_version: ${{ steps.check_version.outputs.remote_version }}
build:
name: Build
needs: check_update
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set env
run: |
echo remote_version=${{ needs.check_update.outputs.remote_version }} | tee -a $GITHUB_ENV
echo build_time=$(TZ=Asia/Shanghai date '+%Y%m%d%H%M') | tee -a $GITHUB_ENV
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2
name: Install packages
id: runcmd
with:
arch: aarch64
distro: ubuntu_latest
run: |
bash chroot-alpine.sh
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.remote_version }}
body: |
Build time: ${{ env.build_time }}
prerelease: false
files: |
/home/runner/work/xz-static/xz-static/aarch64.tar