Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-hellhake committed Jun 9, 2024
1 parent 9fa45e3 commit 0932121
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 85 deletions.
60 changes: 2 additions & 58 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,14 @@ name: Release

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
branches:
- test

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Dump upload url to file
run: echo '${{ steps.create_release.outputs.upload_url }}' > upload_url
- name: Upload upload_url
uses: actions/upload-artifact@v1
with:
name: upload_url
path: upload_url

build:
needs: create-release
strategy:
matrix:
platform: [
'linux-arm',
'linux-arm64',
'linux-x64',
]
pair: [
Expand All @@ -42,10 +18,6 @@ jobs:
'node:14',
]
include:
- platform: 'linux-arm'
host-os: 'ubuntu-latest'
- platform: 'linux-arm64'
host-os: 'ubuntu-latest'
- platform: 'linux-x64'
host-os: 'ubuntu-latest'
- pair: 'node:10'
Expand All @@ -61,14 +33,6 @@ jobs:
runs-on: ${{ matrix.host-os }}

steps:
- name: Download upload_url
uses: actions/download-artifact@v1
with:
name: upload_url
- name: Set upload_url
run: echo "UPLOAD_URL=$(cat upload_url/upload_url)" >> $GITHUB_ENV
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.version }}
uses: actions/setup-node@v4
Expand All @@ -77,23 +41,3 @@ jobs:
- name: Build adapter
run: |
./build.sh "${{ matrix.platform }}" "${{ matrix.language }}" "${{ matrix.version }}"
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: zigbee-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz
asset_name: zigbee-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz
asset_content_type: application/gnutar
- name: Upload Release Asset Checksum
id: upload-release-asset-checksum
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: zigbee-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz.sha256sum
asset_name: zigbee-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz.sha256sum
asset_content_type: text/plain
14 changes: 9 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ function install_osx_compiler() {
}

function install_linux_cross_compiler() {
sudo apt -qq update
sudo apt install --no-install-recommends -y \
binfmt-support \
qemu \
qemu-user-static
#sudo apt -qq update
#sudo apt install --no-install-recommends -y \
# binfmt-support \
# qemu \
# qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
}

Expand All @@ -56,6 +56,10 @@ function build_native() {
}

function build_cross_compiled() {
echo $UID
whoami
echo webthingsio/toolchain-${ADDON_ARCH}-${LANGUAGE_NAME}-${LANGUAGE_VERSION}
docker run --rm -t -v $PWD:/build webthingsio/toolchain-${ADDON_ARCH}-${LANGUAGE_NAME}-${LANGUAGE_VERSION} bash -c 'echo $UID'
docker run --rm -t -v $PWD:/build webthingsio/toolchain-${ADDON_ARCH}-${LANGUAGE_NAME}-${LANGUAGE_VERSION} bash -c "cd /build; ADDON_ARCH=${ADDON_ARCH} ./package.sh"
}

Expand Down
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Setup environment for building inside Dockerized toolchain
export NVM_DIR="${HOME}/.nvm"
printenv
[ -s "${NVM_DIR}/nvm.sh" ] && source "${NVM_DIR}/nvm.sh"
[ $(id -u) = 0 ] && umask 0

Expand All @@ -14,7 +15,7 @@ else
TARFILE_SUFFIX="-${ADDON_ARCH}-${NODE_VERSION/\.*/}"
fi

npm ci
npm ci --loglevel verbose
npm run build
npm prune --production

Expand Down

0 comments on commit 0932121

Please sign in to comment.