Skip to content

bump tools-host

bump tools-host #1

Workflow file for this run

name: dl-hosttools
on:
push:
branches: [ master ]
paths:
- '.github/workflows/dl-hosttools.yml'
- 'tools/dl-hosttools'
- 'make/host-tools/tools-host/tools-host.mk'
workflow_dispatch:
jobs:
build:
container:
# image: ubuntu:20.04
# image: freetzng/dl-packs
image: ghcr.io/freetz-ng/dl-packs
runs-on: ubuntu-latest
steps:
# - name: update
# run: apt-get -y update && apt-get -y upgrade && apt-get -y dist-upgrade
#
# - name: install
# run: |
# DEBIAN_FRONTEND=noninteractive apt-get -y install \
# locales bash \
# pv cpio rsync kmod imagemagick inkscape graphicsmagick subversion git bc unar wget sudo gcc g++ binutils autoconf automake \
# autopoint libtool-bin make bzip2 libncurses5-dev libreadline-dev zlib1g-dev flex bison patch texinfo tofrodos gettext pkg-config ecj \
# perl libstring-crc32-perl ruby ruby1.9 gawk libusb-dev unzip intltool libacl1-dev libcap-dev libc6-dev-i386 lib32ncurses5-dev \
# gcc-multilib bsdmainutils lib32stdc++6 libglib2.0-dev ccache cmake lib32z1-dev libsqlite3-dev sqlite3 libzstd-dev netcat curl \
# uuid-dev libssl-dev libgnutls28-dev u-boot-tools device-tree-compiler openssl build-essential libelf-dev
#
# - name: locale
# run: locale-gen en_US.utf8 && locale-gen de_DE.UTF-8 && update-locale
- name: clone
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
umask 0022
git config --global --add safe.directory $GITHUB_WORKSPACE
git clone https://github-actions:$GITHUB_TOKEN@${GITHUB_SERVER_URL##*/}/$GITHUB_REPOSITORY.git $GITHUB_WORKSPACE --branch $GITHUB_REF_NAME
- name: cache
uses: actions/cache@v3
with:
path: |
dl/*
!dl/tools-*.tar.xz
key: ${{ github.workflow }}
- name: version
id: version
run: |
export VERSION="r$(tools/freetz_revision short)"
[ -n "$VERSION" ] && echo "version=$VERSION" >> $GITHUB_OUTPUT || exit 1
echo "################################################################" && bash -c "echo VERSION=$VERSION"
- name: generate
env:
ACTIONS_VERSION: ${{ steps.version.outputs.version }}
run: |
mkdir -p dl/ 2>/dev/null || true
useradd freetz -s $(which bash) -d $(pwd) -M && chown freetz . -R
su freetz -c "umask 0022 && tools/dl-hosttools $ACTIONS_VERSION && rm -f tools-$ACTIONS_VERSION.*"
- name: cleanup
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --local credential.helper '!x() { echo "password=$GITHUB_TOKEN"; };x'
git tag -d dl-hosttools && git push --delete origin dl-hosttools || true
- name: release
uses: ncipollo/release-action@v1
with:
tag: dl-hosttools
name: dl-hosttools
body: These files are internally used!
prerelease: true
allowUpdates: true
removeArtifacts: false
artifacts: "dl/tools-${{ steps.version.outputs.version }}.tar.xz"
token: ${{ secrets.GITHUB_TOKEN }}
replacesArtifacts: false
artifactErrorsFailBuild: false
draft: true
- name: bump
env:
ACTIONS_VERSION: ${{ steps.version.outputs.version }}
run: |
SHA256="$(sha256sum dl/tools-$ACTIONS_VERSION.tar.xz)"
sed -r "s/^(\\$\(call TOOLS_INIT,).*/\1 ${ACTIONS_VERSION})/" -i make/host-tools/tools-host/tools-host.mk
sed -r "s/^(\\$\(PKG\)_HASH:)=.*/\1=${SHA256%% *}/" -i make/host-tools/tools-host/tools-host.mk
sed -r "s,^(\\$\(PKG\)_SITE:)=.*,\1=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/dl-hosttools," -i make/host-tools/tools-host/tools-host.mk
# - name: commit
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# git config --global --add safe.directory $GITHUB_WORKSPACE
# git pull
# git add .
# git status
# git config --local user.name github-actions
# git config --local user.email github-actions@github.com
# git diff --cached --quiet && exit 0 || git commit -m "dl-hosttools: automatic update"
# git config --local credential.helper '!x() { echo "password=$GITHUB_TOKEN"; };x'
# git push origin $GITHUB_REF_NAME