From 66001dc788072107adbdbf57bfb535df9ca9e981 Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Tue, 17 Nov 2020 11:04:08 +0900 Subject: [PATCH 01/19] remove travis ci Signed-off-by: Inho Oh --- .travis.yml | 45 --------------------------------------------- README.md | 2 -- changes.sh | 39 --------------------------------------- trigger.sh | 25 ------------------------- 4 files changed, 111 deletions(-) delete mode 100644 .travis.yml delete mode 100755 changes.sh delete mode 100755 trigger.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 301176de40..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -language: shell -dist: xenial -env: - global: - - REPO=nugu-linux - - REPOSLUG=nugu-developers/nugu-linux - - UPLOAD=0 -addons: - apt: - packages: - - jq -branches: - only: - - master - - ubuntu - - allwinner - - tizen - -script: | - export SHA=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X GET https://api.github.com/repos/${REPOSLUG}/commits/master | jq '.sha' -r) - export SHORTSHA=$(echo ${SHA} | cut -c -7) - export TRAVIS_TAG=${SHORTSHA} - - mkdir /tmp/result - - ./changes.sh /tmp/result/CHANGES.txt - if [ -f /tmp/result/CHANGES.txt ]; then - UPLOAD=1 - fi - - ./trigger.sh nugulinux sdk-unstable allwinner - ./trigger.sh nugulinux sdk-unstable ubuntu - ./trigger.sh nugulinux sdk-unstable tizen - echo "Upload = $UPLOAD" - -deploy: - provider: releases - api_key: - secure: n+T33vCZNGTLlISJw/olUQHWXmAL4WvSyeiSKR6iamVb49axHcsBdHtMHnagTWCcwDRhJrKokmgn8pzjXnChANaTwp9ySxCmWhxYt1sOKQwHV3exl+5ilY3EqbEJxNRauckuT5w3kLTa6206Dh+ah+sLm8e42mAWuZJiAUQUKFOuOA7kdsWqCo9vNScd+7gFs/7EnMapsvWD43Jzo568VnyNXZK04GTmaUwoei2YV/aB4fe/stW+adCK7SmWCzeeY5a1fq7bgzJzKR8EpAJMOyoU5GaNdY1bxUsAguYEyS8l9I9t+RaP3OExXKYbxAxeh26cvpGSM1m9bYXK9Tt+AdDU1OmsGNULqzieLixH0BCByMqV7v+gGGqOQISGSWbWDQPoFZRY4YLODkVgL6wt4vMCLhvOevX790mWF8oDCE+aZwqvBOGfmUnZKoX0omTUwLHqLf+p+FZKsh4gzkbtY9QzDhrqyjTVFt5h83sZRe9qR/llxKfsP3k4b4ukAzVrRkqO2mtTjwMd9zmosOFxQH5XZqqqwiTtRf7aGcS92TaZvqHkhcXDpZTjp8/Uk/VfompKHzYkcyfO+WeYI37mLhye4HdMvWvl09D2Fp7do3ZjzYp352hnG4PG+yhiW/NAk2jNh9vYIpzniMVBcNRk0dYDGuY9OOgrJQ6QN4eO2e0= - file_glob: true - file: /tmp/result/* - on: - repo: nugulinux/sdk-unstable - condition: $UPLOAD = 1 - overwrite: true diff --git a/README.md b/README.md index 0b57df8292..103a6aef60 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[![Build Status](https://travis-ci.org/nugulinux/sdk-unstable.svg?branch=master)](https://travis-ci.org/nugulinux/sdk-unstable) - # NUGU SDK for Linux unstable repository Unstable release page: diff --git a/changes.sh b/changes.sh deleted file mode 100755 index 594997a71a..0000000000 --- a/changes.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -if [ $# != 1 ]; then - echo "Usage: $0 {flag-file-name}" - exit 1 -fi - -echo "> output flag file: $1" - -echo "> TRAVIS_ACCESS_TOKEN: $TRAVIS_ACCESS_TOKEN" - -# Check for duplicate releases -ID=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X GET https://api.github.com/repos/${TRAVIS_REPO_SLUG}/releases/tags/${SHORTSHA} | jq '.id' -r) -echo "> Release ID = ${ID}" -if [[ ${ID} != "null" ]]; then - echo "Skip deploy to release ${ID}" - exit -fi - -# Get commit message -MSG=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X GET https://api.github.com/repos/${REPOSLUG}/commits/master | jq '.commit.message' -r) - -# Create new release -jq -n --arg body "${MSG}" \ - --arg tag_name "${SHORTSHA}" \ - --arg name "${SHORTSHA}" \ - '{ "tag_name": $tag_name, "name": $name, "body": $body }' | curl -D - \ - -H "Authorization: token ${GITHUB_TOKEN}" \ - -X POST https://api.github.com/repos/${TRAVIS_REPO_SLUG}/releases -d@- - -# Get commit history from latest official release tag -git clone https://github.com/${REPOSLUG} -cd ${REPO} -git checkout ${SHA} -git reset --hard -git log $(git describe --tags --abbrev=0)..HEAD --oneline > $1 -cd - -rm -rf ${REPO} diff --git a/trigger.sh b/trigger.sh deleted file mode 100755 index a7f235d459..0000000000 --- a/trigger.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -if [ $# != 3 ]; then - echo "Usage: $0 {repo_owner} {repo_name} {branch}" - exit 1 -fi - -TRAVIS_ACCESS_TOKEN=zVfGbxmw0I_zz4EAXvbDZA -REPO_OWNER=$1 -REPO_NAME=$2 -BRANCH=$3 - -echo "> Travis trigger REPO = ${REPO_OWNER}/${REPO_NAME}" -echo "> Travis trigger BRANCH = ${BRANCH}" - -jq -n --arg branch "${BRANCH}" \ - '{ "request": { "branch": $branch } }' | curl -s -D - \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TRAVIS_ACCESS_TOKEN}" \ - -X POST https://api.travis-ci.org/repo/${REPO_OWNER}%2F${REPO_NAME}/requests -d@- - -echo -echo "> Travis trigger completed (${REPO_OWNER}/${REPO_NAME} ${BRANCH})" From 24d8692be1bbad0e7836f71d54a43b6198d0b55a Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Tue, 17 Nov 2020 11:25:58 +0900 Subject: [PATCH 02/19] add Github Action Signed-off-by: Inho Oh --- .github/workflows/generate-release.yaml | 65 ++++ .github/workflows/release-CHANGES.yaml | 34 ++ .github/workflows/release-allwinner.yaml | 129 ++++++++ .github/workflows/release-tizen.yaml | 169 ++++++++++ .github/workflows/release-ubuntu.yaml | 393 +++++++++++++++++++++++ README.md | 2 + docker/Dockerfile | 27 ++ 7 files changed, 819 insertions(+) create mode 100644 .github/workflows/generate-release.yaml create mode 100644 .github/workflows/release-CHANGES.yaml create mode 100644 .github/workflows/release-allwinner.yaml create mode 100644 .github/workflows/release-tizen.yaml create mode 100644 .github/workflows/release-ubuntu.yaml create mode 100644 docker/Dockerfile diff --git a/.github/workflows/generate-release.yaml b/.github/workflows/generate-release.yaml new file mode 100644 index 0000000000..d2a2394c54 --- /dev/null +++ b/.github/workflows/generate-release.yaml @@ -0,0 +1,65 @@ +name: Generate Release +on: + push: + branches: + - master + schedule: + - cron: "0 0 * * *" + +env: + REPO: nugu-linux + REPOSLUG: nugu-developers/nugu-linux + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Get last commit from nugu-developers/nugu-linux + id: get-commit + env: + GITHUB_EVENT: ${{ toJson(github.event) }} + run: | + LAST_COMMIT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${REPOSLUG}/commits/master) + SHA=$(echo $LAST_COMMIT | jq '.sha' -r) + SHORTSHA=$(echo $SHA | cut -c -7) + MSG=$(echo $LAST_COMMIT | jq '.commit.message' -r) + + TZ=UTC date + TZ=Asia/Seoul date + echo "event = $GITHUB_EVENT" + echo "event_name = ${{ github.event_name }}" + + echo "SHA=$SHA" + echo "SHORTSHA=$SHORTSHA" + echo "MSG=$MSG" + echo "::set-output name=sha::$SHA" + echo "::set-output name=shortsha::$SHORTSHA" + echo "::set-output name=body::$MSG" + + - name: Check existing release for ${{ steps.get-commit.outputs.shortsha }} + id: last-release + run: | + echo "SHA=${{ steps.get-commit.outputs.sha }}" + ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${{ steps.get-commit.outputs.shortsha }} | jq '.id' -r) + echo "> Release ID = ${ID}" + if [[ ${ID} != "null" ]]; then + echo "Release ${ID} is already exist" + echo "::set-output name=exist::1" + else + echo "Release ${ID} is not exist." + echo "::set-output name=exist::0" + fi + + - name: Done + if: ${{ steps.last-release.outputs.exist == '1'}} + run: echo "Done" + + - name: Generate new release + if: ${{ steps.last-release.outputs.exist == '0'}} + run: | + jq -n --arg body "${{ steps.get-commit.outputs.body }}" \ + --arg tag_name "${{ steps.get-commit.outputs.shortsha }}" \ + --arg name "${{ steps.get-commit.outputs.shortsha }}" \ + '{ "tag_name": $tag_name, "name": $name, "body": $body }' | curl -D - \ + -H "Authorization: token ${{ secrets.GH_TOKEN }}" \ + -X POST https://api.github.com/repos/${GITHUB_REPOSITORY}/releases -d@- diff --git a/.github/workflows/release-CHANGES.yaml b/.github/workflows/release-CHANGES.yaml new file mode 100644 index 0000000000..177fc5259e --- /dev/null +++ b/.github/workflows/release-CHANGES.yaml @@ -0,0 +1,34 @@ +name: Build CHANGES.txt +on: + release: + types: + - created + +env: + REPO: nugu-linux + REPOSLUG: nugu-developers/nugu-linux + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Generate CHANGES.txt + run: | + # Remove "refs/tags/" from "refs/tags/xxxxxxx" + SHORTSHA=$(echo ${GITHUB_REF} | cut -c11-) + + git clone https://github.com/${REPOSLUG} + cd ${REPO} + git checkout ${SHORTSHA} + git reset --hard + git log $(git describe --tags --abbrev=0)..HEAD --oneline > ../CHANGES.txt + cd .. + cat CHANGES.txt + + - name: Upload + uses: svenstaro/upload-release-action@2.2.0 + with: + file: CHANGES.txt + repo_token: ${{ secrets.GH_TOKEN }} + overwrite: true + tag: ${{ github.ref }} diff --git a/.github/workflows/release-allwinner.yaml b/.github/workflows/release-allwinner.yaml new file mode 100644 index 0000000000..4e2a4583fc --- /dev/null +++ b/.github/workflows/release-allwinner.yaml @@ -0,0 +1,129 @@ +name: Build Allwinner +on: + release: + types: + - created + +env: + REPO: nugu-linux + REPOSLUG: nugu-developers/nugu-linux + +# +# Jobs +# -> build +# - Generate .tgz +# - Upload to Github release +# + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Get SHA and ID from Release ${{ github.ref }} + id: check + run: | + # Remove "refs/tags/" from "refs/tags/xxxxxxx" + SHORTSHA=$(echo ${GITHUB_REF} | cut -c11-) + echo "SHA: $SHORTSHA" + + # Get ID for Release-tag + ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${SHORTSHA} | jq '.id' -r) + echo "> Release ID = ${ID}" + if [[ ${ID} == "null" ]]; then + echo "Release ${ID} not exist." + exit + fi + echo "Release-ID: $ID" + + echo "::set-output name=id::$ID" + echo "::set-output name=sha::$SHORTSHA" + + - name: Check for duplicated files + id: dupcheck + run: | + COUNT=0 + MATCH_COUNT=1 + RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.check.outputs.id }}/assets?per_page=50) + FILES=$(echo $RESULT | jq '.[].name' -r) + + for item in $FILES + do + echo "Check artifacts - $item" + + if [[ $item == *"allwinner"* ]]; then + : + else + continue; + fi + + declare -i COUNT; COUNT+=1 + echo "> Found build artifacts: [${COUNT}/${MATCH_COUNT}] ${item}" + done + + # Mark to flag file to trigger the build + if [[ $COUNT == $MATCH_COUNT ]]; then + echo "> There is no need to rebuild." + echo "::set-output name=exist::1" + else + echo "> Rebuild required" + echo "::set-output name=exist::0" + fi + + - name: The build artifact already exists, so the build is skipped. + if: ${{ steps.dupcheck.outputs.exist == '1'}} + run: echo "Done" + + - name: Build + if: ${{ steps.dupcheck.outputs.exist == '0'}} + run: | + git clone https://github.com/${REPOSLUG} --recursive + cd ${REPO} + git checkout ${{ steps.setup.outputs.sha }} + git reset --hard + rm -rf .git + + # Fix permissions for docker + chmod 777 $PWD + + cat < sdkbuild.sh + #!/bin/zsh + set -e + + mkdir -p /mnt/UDISK + + rm -rf build + mkdir build + cd build + + cmake .. \ + -DCMAKE_INSTALL_PREFIX=/mnt/UDISK \ + -DCMAKE_INSTALL_LIBDIR=/mnt/UDISK/lib \ + -DCMAKE_TOOLCHAIN_FILE=/opt/toolchain/Toolchain.cmake + make -j6 + make install + mv /mnt/UDISK ./SDK + tar cvfz files_allwinner_${{ steps.setup.outputs.sha }}.tgz SDK + EOF + + chmod 755 sdkbuild.sh + + echo "> Build cross-compile" + docker run -t --rm -v $PWD:$PWD -w $PWD \ + nugulinux/devenv:allwinner ./sdkbuild.sh + + mkdir /tmp/result + cp build/files_*.tgz /tmp/result/ + + cd .. + whoami + ls -l + + - name: Upload + if: ${{ steps.dupcheck.outputs.exist == '0'}} + uses: svenstaro/upload-release-action@2.2.0 + with: + file: /tmp/result/* + file_glob: true + repo_token: ${{ secrets.GH_TOKEN }} + overwrite: true + tag: ${{ github.ref }} diff --git a/.github/workflows/release-tizen.yaml b/.github/workflows/release-tizen.yaml new file mode 100644 index 0000000000..ce6053ebf8 --- /dev/null +++ b/.github/workflows/release-tizen.yaml @@ -0,0 +1,169 @@ +name: Build Tizen +on: + release: + types: + - created + +env: + REPO: nugu-linux + REPOSLUG: nugu-developers/nugu-linux + +# +# Jobs +# check +# -> build (matrix: emulator, device) +# - Generate .tgz +# - Upload to Github release +# + +jobs: + check: + runs-on: ubuntu-latest + outputs: + release_id: ${{ steps.check.outputs.id }} + sha: ${{ steps.check.outputs.sha }} + steps: + - name: Get SHA and ID from Release ${{ github.ref }} + id: check + run: | + # Remove "refs/tags/" from "refs/tags/xxxxxxx" + SHORTSHA=$(echo ${GITHUB_REF} | cut -c11-) + echo "SHA: $SHORTSHA" + + # Get ID for Release-tag + ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${SHORTSHA} | jq '.id' -r) + echo "> Release ID = ${ID}" + if [[ ${ID} == "null" ]]; then + echo "Release ${ID} not exist." + exit + fi + echo "Release-ID: $ID" + + echo "::set-output name=id::$ID" + echo "::set-output name=sha::$SHORTSHA" + + build: + runs-on: ubuntu-latest + needs: check + strategy: + fail-fast: true + matrix: + target: [emulator, device] + steps: + - name: Setup + id: setup + run: | + echo "::set-output name=id::${{ needs.check.outputs.release_id }}" + echo "::set-output name=sha::${{ needs.check.outputs.sha }}" + + - name: Check for duplicated files + id: check + run: | + COUNT=0 + MATCH_COUNT=1 + RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=50) + FILES=$(echo $RESULT | jq '.[].name' -r) + + for item in $FILES + do + echo "Check artifacts - $item" + + if [[ $item == *"tizen"* ]]; then + : + else + continue; + fi + + if [[ $item == *"${{ matrix.target }}"* ]]; then + : + else + continue; + fi + + declare -i COUNT; COUNT+=1 + echo "> Found build artifacts: [${COUNT}/${MATCH_COUNT}] ${item}" + done + + # Mark to flag file to trigger the build + if [[ $COUNT == $MATCH_COUNT ]]; then + echo "> There is no need to rebuild." + echo "::set-output name=exist::1" + else + echo "> Rebuild required" + echo "::set-output name=exist::0" + fi + + - name: The build artifact already exists, so the build is skipped. + if: ${{ steps.check.outputs.exist == '1'}} + run: echo "Done" + + - name: Build + if: ${{ steps.check.outputs.exist == '0'}} + run: | + git clone https://github.com/${REPOSLUG} --recursive + cd ${REPO} + git checkout ${{ steps.setup.outputs.sha }} + git reset --hard + rm -rf .git + + # Fix permissions for docker + chmod 777 $PWD -R + + SDKPATH=$PWD/SDK + echo "> SDK Install PATH=$SDKPATH" + + cat < sdkbuild.sh + #!/bin/zsh + set -e + + source ~/${{ matrix.target }}.env + + echo $PWD + + rm -rf SDK + mkdir SDK + + rm -rf build + mkdir build + + cd build + cmake .. \ + -DCMAKE_INSTALL_PREFIX=/ \ + -DCMAKE_TOOLCHAIN_FILE=~/Toolchain.cmake \ + -DENABLE_LOG_ANSICOLOR=OFF \ + -DENABLE_OPUS_PLUGIN=ON \ + -DENABLE_GSTREAMER_PLUGIN=OFF \ + -DENABLE_PORTAUDIO_PLUGIN=OFF \ + -DENABLE_VENDOR_LIBRARY=ON \ + -DENABLE_OPUS_LIBRARY=ON + + make -j6 + + DESTDIR=$SDKPATH make install + + cd .. + tar cvfz files_tizen_${{ matrix.target }}_${{ steps.setup.outputs.sha }}.tgz SDK + EOF + + chmod 755 sdkbuild.sh + + echo "> Build cross-compile" + docker run -t --rm -v $PWD:$PWD -w $PWD \ + nugulinux/devenv:tizen ./sdkbuild.sh + + mkdir /tmp/result + cp files_*.tgz /tmp/result/ + + cd .. + whoami + ls -l + + - name: Upload + if: ${{ steps.check.outputs.exist == '0'}} + uses: svenstaro/upload-release-action@2.2.0 + with: + file: /tmp/result/* + file_glob: true + repo_token: ${{ secrets.GH_TOKEN }} + overwrite: true + tag: ${{ github.ref }} diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml new file mode 100644 index 0000000000..a3b550cc4d --- /dev/null +++ b/.github/workflows/release-ubuntu.yaml @@ -0,0 +1,393 @@ +name: Build Ubuntu +on: + release: + types: + - created + +env: + REPO: nugu-linux + REPOSLUG: nugu-developers/nugu-linux + +# +# Jobs +# check +# -> build (matrix) +# - Generate DEB package and .tgz +# - Upload to Github release +# -> pages +# - Doxygen +# - DEB Repository +# - Upload to Github pages +# -> docker +# - Generate nugulinux/sdk:unstable docker image +# + +jobs: + check: + runs-on: ubuntu-latest + outputs: + release_id: ${{ steps.check.outputs.id }} + sha: ${{ steps.check.outputs.sha }} + steps: + - name: Get SHA and ID from Release ${{ github.ref }} + id: check + run: | + # Remove "refs/tags/" from "refs/tags/xxxxxxx" + SHORTSHA=$(echo ${GITHUB_REF} | cut -c11-) + echo "SHA: $SHORTSHA" + + # Get ID for Release-tag + ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${SHORTSHA} | jq '.id' -r) + echo "> Release ID = ${ID}" + if [[ ${ID} == "null" ]]; then + echo "Release ${ID} not exist." + exit + fi + echo "Release-ID: $ID" + + echo "::set-output name=id::$ID" + echo "::set-output name=sha::$SHORTSHA" + + build: + runs-on: ubuntu-latest + needs: check + strategy: + fail-fast: true + matrix: + target: [xenial_x64, xenial_arm64, xenial_armhf, bionic_x64, bionic_arm64, bionic_armhf] + steps: + - name: Setup + id: setup + run: | + UBUNTU_VER=$(echo ${{ matrix.target }} | cut -d "_" -f 1) + ARCH=$(echo ${{ matrix.target }} | cut -d "_" -f 2) + if [ "$ARCH" == "x64" ]; then + ARCH2="amd64" + else + ARCH2="${ARCH}" + fi + + echo "::set-output name=ubuntuver::$UBUNTU_VER" + echo "::set-output name=arch::$ARCH" + echo "::set-output name=arch2::$ARCH2" + echo "::set-output name=id::${{ needs.check.outputs.release_id }}" + echo "::set-output name=sha::${{ needs.check.outputs.sha }}" + + - name: Check for duplicated files + id: check + run: | + COUNT=0 + MATCH_COUNT=6 + RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=50) + FILES=$(echo $RESULT | jq '.[].name' -r) + + for item in $FILES + do + echo "Check artifacts - $item" + + # Check ARCH or ARCH2 + if [[ $item == *"${{ steps.setup.outputs.arch }}"* ]]; then + : + elif [[ $item == *"${{ steps.setup.outputs.arch2 }}"* ]]; then + : + else + continue; + fi + + # Check Ubuntu version (bionic / xenial) + if [[ $item == *"${{ steps.setup.outputs.ubuntuver }}"* ]]; then + : + else + continue; + fi + + declare -i COUNT; COUNT+=1 + echo "> Found build artifacts: [${COUNT}/${MATCH_COUNT}] ${item}" + done + + # Mark to flag file to trigger the build + if [[ $COUNT == $MATCH_COUNT ]]; then + echo "> There is no need to rebuild." + echo "::set-output name=exist::1" + else + echo "> Rebuild required" + echo "::set-output name=exist::0" + fi + + - name: The build artifact already exists, so the build is skipped. + if: ${{ steps.check.outputs.exist == '1'}} + run: echo "Done" + + - name: Start Ubuntu build + id: build + if: ${{ steps.check.outputs.exist == '0'}} + run: | + # Get date for commit to generate version + DATETIME=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${REPOSLUG}/commits/${{ steps.setup.outputs.sha }} | jq '.commit.committer.date' -r) + echo "commit.committer.date = ${DATETIME}" + + STAMP=$(date -d ${DATETIME} +%Y%m%d) + VERSION="${STAMP}${{ steps.setup.outputs.sha }}" + echo "package version = ${VERSION}" + + echo "Clone the sdk repository" + git clone https://github.com/${REPOSLUG} --recursive + cd ${REPO} + git checkout ${{ steps.setup.outputs.sha }} + git reset --hard + rm -rf .git + + echo "Add commit-id(${{ steps.setup.outputs.sha }}) to package version" + sed -i "1 s/ubuntu[0-9]*~xenial/ubuntu${VERSION}~xenial/" packaging/xenial/changelog + sed -i "1 s/ubuntu[0-9]*~bionic/ubuntu${VERSION}~bionic/" packaging/bionic/changelog + head -1 packaging/xenial/changelog + head -1 packaging/bionic/changelog + cd - + + # Fix permissions for docker + chmod 777 $PWD + chmod 777 $PWD/${REPO} + + echo "Build debian package" + docker run -t --rm --privileged -v $PWD:$PWD -w $PWD/${REPO} \ + -v /var/lib/schroot/chroots \ + nugulinux/buildenv:${{ matrix.target }} sdkbuild.sh + + ls -l + + echo "Create /tmp/result" + mkdir /tmp/result + + cp *.deb /tmp/result/ + + echo "Completed" + echo "::set-output name=files::1" + + - name: Generate tgz + if: ${{ steps.build.outputs.files == '1'}} + run: | + FILENAME=files_${{ matrix.target }}_${{ steps.setup.outputs.sha }} + + # Create temporary directory + mkdir dest + + # Extract all deb packages + FILES=$(ls *.deb) + for item in $FILES + do + echo "Extract ${item}" + ar x ${item} + tar -C dest -xvf data.tar.xz + done + + # Generate tgz + cd dest + tar cvfz ../${FILENAME}.tgz . + cd - + + cp ${FILENAME}.tgz /tmp/result/ + + - name: Upload artifact to release + if: ${{ steps.build.outputs.files == '1'}} + uses: svenstaro/upload-release-action@2.2.0 + with: + file: /tmp/result/* + file_glob: true + repo_token: ${{ secrets.GH_TOKEN }} + overwrite: true + tag: ${{ github.ref }} + + pages: + runs-on: ubuntu-latest + needs: [check, build] + env: + BASEROOT: /tmp/www + steps: + - name: Setup + id: setup + run: | + sudo apt-get install doxygen graphviz + + POOL_XENIAL=${BASEROOT}/ubuntu/dists/xenial/pool + POOL_BIONIC=${BASEROOT}/ubuntu/dists/bionic/pool + + DIRS=( + ${POOL_XENIAL} + ${POOL_BIONIC} + ${BASEROOT}/ubuntu/dists/xenial/main/binary-amd64 + ${BASEROOT}/ubuntu/dists/xenial/main/binary-arm64 + ${BASEROOT}/ubuntu/dists/xenial/main/binary-armhf + ${BASEROOT}/ubuntu/dists/bionic/main/binary-amd64 + ${BASEROOT}/ubuntu/dists/bionic/main/binary-arm64 + ${BASEROOT}/ubuntu/dists/bionic/main/binary-armhf + ) + + for item in "${DIRS[@]}" + do + echo "- Create ${item}" + if [[ ! -d ${item} ]]; then + mkdir -p ${item} + fi + done + + # Generate index.html + DATE=$(date) + cat < ${BASEROOT}/index.html + + +

DEB Package repository for unstable release

+ +

+ last unstable commit: ${{ steps.setup.outputs.sha }} +

+ +

+ API Document(doxygen): https://nugulinux.github.io/sdk-unstable/doxygen/ +

+ +
+ +

NUGU SDK for Linux PPA Setup (stable release)

+
+              add-apt-repository ppa:nugulinux/sdk
+              apt-get update
+          
+ +
+ +

Unstable package repository setup

+ +

Bionic (18.04)

+
+              echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ bionic main" > /etc/apt/sources.list.d/nugudev.list
+              apt-get update
+          
+ +

Xenial (16.04)

+
+              echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ xenial main" > /etc/apt/sources.list.d/nugudev.list
+              apt-get update
+          
+ +
+ +

Generated at ${DATE}

+ + + + EOF + + echo "::set-output name=id::${{ needs.check.outputs.release_id }}" + echo "::set-output name=sha::${{ needs.check.outputs.sha }}" + echo "::set-output name=pool_xenial::${POOL_XENIAL}" + echo "::set-output name=pool_bionic::${POOL_BIONIC}" + + - name: Generate doxygen + run: | + git clone https://github.com/${REPOSLUG} + cd ${REPO} + git checkout ${{ steps.setup.outputs.sha }} + git reset --hard + rm -rf .git + + doxygen + mv doc/html ${BASEROOT}/doxygen + cd .. + rm -rf ${REPO} + + - name: Generate unstable DEB repository + run: | + function generate { + DIST=$1 + HOST=$2 + PKGSREPO="dists/${DIST}/pool" + PKGS="dists/${DIST}/main/binary-${HOST}/" + + echo "> DEB Repo: ${PKGSREPO}" + echo "> Packages path: ${PKGS}" + + cd ${BASEROOT}/ubuntu + dpkg-scanpackages -m -a $HOST ${PKGSREPO} > ${PKGS}/Packages + cd - + } + + echo "> Get file list" + RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=50) + FILES=$(echo $RESULT | jq '.[].browser_download_url' -r) + for item in $FILES + do + if [[ $item != *.deb ]]; then + echo "- ignore: ${item}" + continue + fi + + echo "Download ${item}" + + if [[ $item == *"xenial"* ]]; then + echo "- 16.04: ${item}" + wget -nv ${item} -P ${{ steps.setup.outputs.pool_xenial }} + if [[ $item == *"amd64"* ]]; then + generate "xenial" "amd64" + elif [[ $item == *"armhf"* ]]; then + generate "xenial" "armhf" + elif [[ $item == *"arm64"* ]]; then + generate "xenial" "arm64" + fi + elif [[ $item == *"bionic"* ]]; then + echo "- 18.04: ${item}" + wget -nv ${item} -P ${{ steps.setup.outputs.pool_bionic }} + if [[ $item == *"amd64"* ]]; then + generate "bionic" "amd64" + elif [[ $item == *"armhf"* ]]; then + generate "bionic" "armhf" + elif [[ $item == *"arm64"* ]]; then + generate "bionic" "arm64" + fi + else + echo "- unknown version: ${item}" + fi + done + + - name: Deploy to Github Pages + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + BRANCH: gh-pages + FOLDER: /tmp/www + CLEAN: true + + docker: + runs-on: ubuntu-latest + needs: [check, build, pages] + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Generate docker image + run: | + echo "OS=$OSTYPE" + + LAST_COMMIT=`docker run -t --rm nugulinux/sdk:unstable printenv | grep LAST_COMMIT` + echo $LAST_COMMIT + + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + COMMIT=$(echo $LAST_COMMIT | sed -r 's/LAST_COMMIT=(.*)/\1/' | tr -d '\r') + elif [[ "$OSTYPE" == "darwin"* ]]; then + COMMIT=$(echo $LAST_COMMIT | gsed -r 's/LAST_COMMIT=(.*)/\1/' | tr -d '\r') + fi + + echo "SHORTSHA='${{ needs.check.outputs.sha }}'" + echo "nugulinux/sdk:unstable commit='${COMMIT}'" + + if [[ "${COMMIT}" == "${{ needs.check.outputs.sha }}" ]]; then + echo "Same version" + exit 0 + else + echo "not match" + cd docker + docker build --build-arg LAST_COMMIT=${{ needs.check.outputs.sha }} . -t nugulinux/sdk:unstable + cd - + fi + - name: Docker login + run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + - name: Publish + run: docker push nugulinux/sdk:unstable diff --git a/README.md b/README.md index 103a6aef60..0befcd789e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Ubuntu](https://github.com/nugulinux/sdk-unstable/workflows/Build%20Ubuntu/badge.svg)]((https://github.com/nugulinux/sdk-unstable/actions?query=workflow%3A%22Build+Ubuntu%22)) [![Build Allwinner](https://github.com/nugulinux/sdk-unstable/workflows/Build%20Allwinner/badge.svg)]((https://github.com/nugulinux/sdk-unstable/actions?query=workflow%3A%22Build+Allwinner%22)) [![Build Tizen](https://github.com/nugulinux/sdk-unstable/workflows/Build%20Tizen/badge.svg)](https://github.com/nugulinux/sdk-unstable/actions?query=workflow%3A%22Build+Tizen%22) + # NUGU SDK for Linux unstable repository Unstable release page: diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000000..928dece651 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:bionic +LABEL maintainer="nugulinux@gmail.com" \ + version="0.1" \ + description="nugulinux unstable sdk" + +ARG LAST_COMMIT + +ENV DEBIAN_FRONTEND=noninteractive \ + LC_ALL=C \ + LANG=C \ + LANGUAGE=C \ + SHELL=/bin/bash \ + PULSE_SERVER=host.docker.internal \ + LAST_COMMIT=$LAST_COMMIT + +RUN apt-get update && apt-get install -y software-properties-common ca-certificates --no-install-recommends \ + && add-apt-repository -y ppa:nugulinux/sdk \ + && echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ bionic main" > /etc/apt/sources.list.d/nugu-unstable.list \ + && apt-get update && apt-get install -y --no-install-recommends \ + gstreamer1.0-pulseaudio \ + libnugu \ + libnugu-plugins-default \ + libnugu-examples \ + pulseaudio \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/lib/nugu From 365576a1d6869107f01f7def1f2cdec2c0c2f51a Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Wed, 18 Nov 2020 11:57:49 +0900 Subject: [PATCH 03/19] fix allwinner build Signed-off-by: Inho Oh --- .github/workflows/release-allwinner.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-allwinner.yaml b/.github/workflows/release-allwinner.yaml index 4e2a4583fc..350290224b 100644 --- a/.github/workflows/release-allwinner.yaml +++ b/.github/workflows/release-allwinner.yaml @@ -78,7 +78,7 @@ jobs: run: | git clone https://github.com/${REPOSLUG} --recursive cd ${REPO} - git checkout ${{ steps.setup.outputs.sha }} + git checkout ${{ steps.check.outputs.sha }} git reset --hard rm -rf .git @@ -102,7 +102,7 @@ jobs: make -j6 make install mv /mnt/UDISK ./SDK - tar cvfz files_allwinner_${{ steps.setup.outputs.sha }}.tgz SDK + tar cvfz files_allwinner_${{ steps.check.outputs.sha }}.tgz SDK EOF chmod 755 sdkbuild.sh From a29aab8fdd945672d4eee4e988ea88bd411133db Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Wed, 1 Sep 2021 14:15:48 +0900 Subject: [PATCH 04/19] remove Tizen Signed-off-by: Inho Oh --- .github/workflows/release-tizen.yaml | 12 +++++++++--- README.md | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-tizen.yaml b/.github/workflows/release-tizen.yaml index ce6053ebf8..fec2fea09f 100644 --- a/.github/workflows/release-tizen.yaml +++ b/.github/workflows/release-tizen.yaml @@ -1,8 +1,14 @@ name: Build Tizen on: - release: - types: - - created + workflow_dispatch: + inputs: + comment: + description: 'Comment' + required: false + default: '' +# release: +# types: +# - created env: REPO: nugu-linux diff --git a/README.md b/README.md index 0befcd789e..28c6c22fe6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Ubuntu](https://github.com/nugulinux/sdk-unstable/workflows/Build%20Ubuntu/badge.svg)]((https://github.com/nugulinux/sdk-unstable/actions?query=workflow%3A%22Build+Ubuntu%22)) [![Build Allwinner](https://github.com/nugulinux/sdk-unstable/workflows/Build%20Allwinner/badge.svg)]((https://github.com/nugulinux/sdk-unstable/actions?query=workflow%3A%22Build+Allwinner%22)) [![Build Tizen](https://github.com/nugulinux/sdk-unstable/workflows/Build%20Tizen/badge.svg)](https://github.com/nugulinux/sdk-unstable/actions?query=workflow%3A%22Build+Tizen%22) +[![Build Ubuntu](https://github.com/nugulinux/sdk-unstable/workflows/Build%20Ubuntu/badge.svg)]((https://github.com/nugulinux/sdk-unstable/actions?query=workflow%3A%22Build+Ubuntu%22)) [![Build Allwinner](https://github.com/nugulinux/sdk-unstable/workflows/Build%20Allwinner/badge.svg)]((https://github.com/nugulinux/sdk-unstable/actions?query=workflow%3A%22Build+Allwinner%22)) # NUGU SDK for Linux unstable repository From f709e1585f5b04b24c901f04116aedac825f6bad Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Thu, 2 Sep 2021 15:26:38 +0900 Subject: [PATCH 05/19] fix github action to support multi-arch Signed-off-by: Inho Oh --- .github/workflows/release-CHANGES.yaml | 1 + .github/workflows/release-ubuntu.yaml | 63 ++++++++++++++++++++------ 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-CHANGES.yaml b/.github/workflows/release-CHANGES.yaml index 177fc5259e..b0725f1cfc 100644 --- a/.github/workflows/release-CHANGES.yaml +++ b/.github/workflows/release-CHANGES.yaml @@ -18,6 +18,7 @@ jobs: SHORTSHA=$(echo ${GITHUB_REF} | cut -c11-) git clone https://github.com/${REPOSLUG} + touch CHANGES.txt cd ${REPO} git checkout ${SHORTSHA} git reset --hard diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml index a3b550cc4d..36f39ca737 100644 --- a/.github/workflows/release-ubuntu.yaml +++ b/.github/workflows/release-ubuntu.yaml @@ -203,6 +203,8 @@ jobs: env: BASEROOT: /tmp/www steps: + - name: Check out the repo + uses: actions/checkout@v2 - name: Setup id: setup run: | @@ -349,12 +351,13 @@ jobs: done - name: Deploy to Github Pages - uses: JamesIves/github-pages-deploy-action@3.7.1 + uses: JamesIves/github-pages-deploy-action@4.1.5 with: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - BRANCH: gh-pages - FOLDER: /tmp/www - CLEAN: true + token: ${{ secrets.GH_TOKEN }} + branch: gh-pages + folder: /tmp/www + clean: true + single-commit: true docker: runs-on: ubuntu-latest @@ -363,31 +366,63 @@ jobs: - name: Check out the repo uses: actions/checkout@v2 - name: Generate docker image + id: check run: | echo "OS=$OSTYPE" + function docker_check() { + docker pull nugulinux/sdk:unstable + } + + if docker_check; then + echo "Download success" + else + echo "Image not exist" + echo "::set-output name=commit::x" + exit + fi + LAST_COMMIT=`docker run -t --rm nugulinux/sdk:unstable printenv | grep LAST_COMMIT` echo $LAST_COMMIT + COMMIT= if [[ "$OSTYPE" == "linux-gnu"* ]]; then COMMIT=$(echo $LAST_COMMIT | sed -r 's/LAST_COMMIT=(.*)/\1/' | tr -d '\r') elif [[ "$OSTYPE" == "darwin"* ]]; then COMMIT=$(echo $LAST_COMMIT | gsed -r 's/LAST_COMMIT=(.*)/\1/' | tr -d '\r') fi - echo "SHORTSHA='${{ needs.check.outputs.sha }}'" echo "nugulinux/sdk:unstable commit='${COMMIT}'" + echo "::set-output name=commit::${COMMIT}" if [[ "${COMMIT}" == "${{ needs.check.outputs.sha }}" ]]; then echo "Same version" - exit 0 else echo "not match" - cd docker - docker build --build-arg LAST_COMMIT=${{ needs.check.outputs.sha }} . -t nugulinux/sdk:unstable - cd - fi - - name: Docker login - run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - - name: Publish - run: docker push nugulinux/sdk:unstable + - name: Information + run: | + echo "${{ needs.check.outputs.sha }}" + echo "${{ steps.check.outputs.commit }}" + - name: Set up QEMU + if: ${{ steps.check.outputs.commit != needs.check.outputs.sha }} + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + if: ${{ steps.check.outputs.commit != needs.check.outputs.sha }} + uses: docker/setup-buildx-action@v1 + - name: Login to GitHub Container Registry + if: ${{ steps.check.outputs.commit != needs.check.outputs.sha }} + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push + if: ${{ steps.check.outputs.commit != needs.check.outputs.sha }} + uses: docker/build-push-action@v2 + with: + context: docker/. + platforms: linux/amd64,linux/arm64 + push: true + tags: nugulinux/sdk:unstable + build-args: | + LAST_COMMIT=${{ needs.check.outputs.sha }} From b9851f5579612ef3481a3e3a60eaa6ea279c9643 Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Wed, 29 Sep 2021 15:52:04 +0900 Subject: [PATCH 06/19] add 20.04(focal) support add Ubuntu 20.04(focal) support Signed-off-by: Inho Oh --- .github/workflows/release-ubuntu.yaml | 39 +++++++++++++++++++++++++-- README.md | 4 +++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml index 36f39ca737..dc57486fc0 100644 --- a/.github/workflows/release-ubuntu.yaml +++ b/.github/workflows/release-ubuntu.yaml @@ -54,7 +54,18 @@ jobs: strategy: fail-fast: true matrix: - target: [xenial_x64, xenial_arm64, xenial_armhf, bionic_x64, bionic_arm64, bionic_armhf] + target: + [ + xenial_x64, + xenial_arm64, + xenial_armhf, + bionic_x64, + bionic_arm64, + bionic_armhf, + focal_x64, + focal_arm64, + focal_armhf, + ] steps: - name: Setup id: setup @@ -94,7 +105,7 @@ jobs: continue; fi - # Check Ubuntu version (bionic / xenial) + # Check Ubuntu version (focal / bionic / xenial) if [[ $item == *"${{ steps.setup.outputs.ubuntuver }}"* ]]; then : else @@ -140,8 +151,10 @@ jobs: echo "Add commit-id(${{ steps.setup.outputs.sha }}) to package version" sed -i "1 s/ubuntu[0-9]*~xenial/ubuntu${VERSION}~xenial/" packaging/xenial/changelog sed -i "1 s/ubuntu[0-9]*~bionic/ubuntu${VERSION}~bionic/" packaging/bionic/changelog + sed -i "1 s/ubuntu[0-9]*~focal/ubuntu${VERSION}~focal/" packaging/focal/changelog head -1 packaging/xenial/changelog head -1 packaging/bionic/changelog + head -1 packaging/focal/changelog cd - # Fix permissions for docker @@ -212,16 +225,21 @@ jobs: POOL_XENIAL=${BASEROOT}/ubuntu/dists/xenial/pool POOL_BIONIC=${BASEROOT}/ubuntu/dists/bionic/pool + POOL_FOCAL=${BASEROOT}/ubuntu/dists/focal/pool DIRS=( ${POOL_XENIAL} ${POOL_BIONIC} + ${POOL_FOCAL} ${BASEROOT}/ubuntu/dists/xenial/main/binary-amd64 ${BASEROOT}/ubuntu/dists/xenial/main/binary-arm64 ${BASEROOT}/ubuntu/dists/xenial/main/binary-armhf ${BASEROOT}/ubuntu/dists/bionic/main/binary-amd64 ${BASEROOT}/ubuntu/dists/bionic/main/binary-arm64 ${BASEROOT}/ubuntu/dists/bionic/main/binary-armhf + ${BASEROOT}/ubuntu/dists/focal/main/binary-amd64 + ${BASEROOT}/ubuntu/dists/focal/main/binary-arm64 + ${BASEROOT}/ubuntu/dists/focal/main/binary-armhf ) for item in "${DIRS[@]}" @@ -259,6 +277,12 @@ jobs:

Unstable package repository setup

+

Focal (20.04)

+
+              echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ focal main" > /etc/apt/sources.list.d/nugudev.list
+              apt-get update
+          
+

Bionic (18.04)

               echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ bionic main" > /etc/apt/sources.list.d/nugudev.list
@@ -283,6 +307,7 @@ jobs:
           echo "::set-output name=sha::${{ needs.check.outputs.sha }}"
           echo "::set-output name=pool_xenial::${POOL_XENIAL}"
           echo "::set-output name=pool_bionic::${POOL_BIONIC}"
+          echo "::set-output name=pool_focal::${POOL_FOCAL}"
 
       - name: Generate doxygen
         run: |
@@ -345,6 +370,16 @@ jobs:
               elif [[ $item == *"arm64"* ]]; then
                 generate "bionic" "arm64"
               fi
+            elif [[ $item == *"focal"* ]]; then
+              echo "- 20.04: ${item}"
+              wget -nv ${item} -P ${{ steps.setup.outputs.pool_focal }}
+              if [[ $item == *"amd64"* ]]; then
+                generate "focal" "amd64"
+              elif [[ $item == *"armhf"* ]]; then
+                generate "focal" "armhf"
+              elif [[ $item == *"arm64"* ]]; then
+                generate "focal" "arm64"
+              fi
             else
               echo "- unknown version: ${item}"
             fi
diff --git a/README.md b/README.md
index 28c6c22fe6..c7dd9b5be3 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,10 @@ Ubuntu 18.04:
 
     deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ bionic main
 
+Ubuntu 20.04:
+
+    deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ focal main
+
 Update the package information
 
     sudo apt-get update

From 00e90721449bba68b9bfe3cd7bd26d58b0b77723 Mon Sep 17 00:00:00 2001
From: Inho Oh 
Date: Thu, 30 Sep 2021 11:45:54 +0900
Subject: [PATCH 07/19] fix per_page option value 50 to 80

Increase the value to 80 to support focal release files.

Signed-off-by: Inho Oh 
---
 .github/workflows/release-allwinner.yaml | 2 +-
 .github/workflows/release-tizen.yaml     | 2 +-
 .github/workflows/release-ubuntu.yaml    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/release-allwinner.yaml b/.github/workflows/release-allwinner.yaml
index 350290224b..1072f8910b 100644
--- a/.github/workflows/release-allwinner.yaml
+++ b/.github/workflows/release-allwinner.yaml
@@ -43,7 +43,7 @@ jobs:
         run: |
           COUNT=0
           MATCH_COUNT=1
-          RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.check.outputs.id }}/assets?per_page=50)
+          RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.check.outputs.id }}/assets?per_page=80)
           FILES=$(echo $RESULT  | jq '.[].name' -r)
 
           for item in $FILES
diff --git a/.github/workflows/release-tizen.yaml b/.github/workflows/release-tizen.yaml
index fec2fea09f..6d029dff1f 100644
--- a/.github/workflows/release-tizen.yaml
+++ b/.github/workflows/release-tizen.yaml
@@ -67,7 +67,7 @@ jobs:
         run: |
           COUNT=0
           MATCH_COUNT=1
-          RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=50)
+          RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=80)
           FILES=$(echo $RESULT  | jq '.[].name' -r)
 
           for item in $FILES
diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml
index dc57486fc0..c6b8497c9e 100644
--- a/.github/workflows/release-ubuntu.yaml
+++ b/.github/workflows/release-ubuntu.yaml
@@ -89,7 +89,7 @@ jobs:
         run: |
           COUNT=0
           MATCH_COUNT=6
-          RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=50)
+          RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=80)
           FILES=$(echo $RESULT  | jq '.[].name' -r)
 
           for item in $FILES
@@ -339,7 +339,7 @@ jobs:
           }
 
           echo "> Get file list"
-          RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=50)
+          RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=80)
           FILES=$(echo $RESULT  | jq '.[].browser_download_url' -r)
           for item in $FILES
           do

From c263f656b521650e271e26889ab662b9abdeaf04 Mon Sep 17 00:00:00 2001
From: Inho Oh 
Date: Wed, 5 Jan 2022 21:43:29 +0900
Subject: [PATCH 08/19] add AGL build

Signed-off-by: Inho Oh 
---
 .github/workflows/release-agl.yaml | 153 +++++++++++++++++++++++++++++
 1 file changed, 153 insertions(+)
 create mode 100644 .github/workflows/release-agl.yaml

diff --git a/.github/workflows/release-agl.yaml b/.github/workflows/release-agl.yaml
new file mode 100644
index 0000000000..611e694021
--- /dev/null
+++ b/.github/workflows/release-agl.yaml
@@ -0,0 +1,153 @@
+name: Build AGL
+on:
+  release:
+    types:
+      - created
+  workflow_dispatch:
+    inputs:
+      hash:
+        description: 'SDK Commit'
+        required: true
+        default: ''
+      comment:
+        description: 'Comment'
+        required: false
+        default: ''
+
+env:
+  REPO: nugu-linux
+  REPOSLUG: nugu-developers/nugu-linux
+
+#
+# Jobs
+#   -> build (matrix)
+#      - Generate .tgz
+#      - Upload to Github release
+#
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: true
+      matrix:
+        target: [ koi_rpi4, koi_x64 ]
+    steps:
+      - name: Get SHA and ID from Release ${{ github.ref }}
+        id: check
+        run: |
+          if [ -z "${{ github.event.inputs.hash }}" ]; then
+            # Remove "refs/tags/" from "refs/tags/xxxxxxx"
+            SHORTSHA=$(echo ${GITHUB_REF} | cut -c11-)
+          else
+            SHORTSHA=${{ github.event.inputs.hash }}
+          fi
+          echo "SHA: $SHORTSHA"
+
+          # Get ID for Release-tag
+          ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${SHORTSHA} | jq '.id' -r)
+          echo "> Release ID = ${ID}"
+          if [[ ${ID} == "null" ]]; then
+            echo "Release ${ID} not exist."
+            exit
+          fi
+          echo "Release-ID: $ID"
+
+          echo "::set-output name=id::$ID"
+          echo "::set-output name=sha::$SHORTSHA"
+
+      - name: Check for duplicated files
+        id: dupcheck
+        run: |
+          COUNT=0
+          MATCH_COUNT=1
+          RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.check.outputs.id }}/assets?per_page=80)
+          FILES=$(echo $RESULT  | jq '.[].name' -r)
+
+          for item in $FILES
+          do
+            echo "Check artifacts - $item"
+
+            if [[ $item == *"agl"* ]]; then
+                :
+            else
+                continue;
+            fi
+
+            declare -i COUNT; COUNT+=1
+            echo "> Found build artifacts: [${COUNT}/${MATCH_COUNT}] ${item}"
+          done
+
+          # Mark to flag file to trigger the build
+          if [[ $COUNT == $MATCH_COUNT ]]; then
+            echo "> There is no need to rebuild."
+            echo "::set-output name=exist::1"
+          else
+            echo "> Rebuild required"
+            echo "::set-output name=exist::0"
+          fi
+
+      - name: The build artifact already exists, so the build is skipped.
+        if: ${{ steps.dupcheck.outputs.exist == '1'}}
+        run: echo "Done"
+
+      - name: Prepare SDK source
+        if: ${{ steps.dupcheck.outputs.exist == '0'}}
+        run: |
+          git clone https://github.com/${REPOSLUG} --recursive
+          cd ${REPO}
+          git checkout ${{ steps.check.outputs.sha }}
+          git reset --hard
+          rm -rf .git
+
+          # Fix permissions for docker
+          chmod 777 $PWD
+
+          ls -l
+
+      - name: Prepare AGL Docker image
+        if: ${{ steps.dupcheck.outputs.exist == '0'}}
+        run: docker pull ghcr.io/webispy/agl:${{ matrix.target }}
+
+      - name: Build
+        if: ${{ steps.dupcheck.outputs.exist == '0'}}
+        run: |
+          cd ${REPO}
+
+          cat < sdkbuild.sh
+          #!/bin/bash
+          set -e
+
+          source /opt/agl-sdk/11.0.4-*/environment-setup-*
+
+          rm -rf build
+          mkdir build
+          cd build
+          cmake .. -DENABLE_OPUS_LIBRARY=ON \
+            -DENABLE_PORTAUDIO_PLUGIN=OFF \
+            -DCMAKE_INSTALL_PREFIX=/usr \
+            -DCMAKE_TOOLCHAIN_FILE=/opt/toolchain/Toolchain.cmake
+          make -j6
+
+          mkdir SDK
+          DESTDIR=SDK make install
+          tar cvfz files_agl_${{ matrix.target }}_${{ steps.check.outputs.sha }}.tgz SDK
+          EOF
+
+          chmod 755 sdkbuild.sh
+
+          echo "> Build cross-compile"
+          docker run -t --rm -v $PWD:$PWD -w $PWD \
+              ghcr.io/webispy/agl:${{ matrix.target }} ./sdkbuild.sh
+
+          cp build/files_*.tgz /tmp/
+
+      - name: Upload
+        if: ${{ steps.dupcheck.outputs.exist == '0'}}
+        uses: svenstaro/upload-release-action@2.2.0
+        with:
+          file: /tmp/*.tgz
+          file_glob: true
+          repo_token: ${{ secrets.GH_TOKEN }}
+          overwrite: true
+          tag: ${{ github.ref }}

From d59ff742488edc24f2735dd712de7957a8cde7ed Mon Sep 17 00:00:00 2001
From: Inho Oh 
Date: Fri, 7 Jan 2022 18:13:15 +0900
Subject: [PATCH 09/19] fix release-agl.yaml to turn off ASAN option

Signed-off-by: Inho Oh 
---
 .github/workflows/release-agl.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/release-agl.yaml b/.github/workflows/release-agl.yaml
index 611e694021..bed8d6397d 100644
--- a/.github/workflows/release-agl.yaml
+++ b/.github/workflows/release-agl.yaml
@@ -125,6 +125,7 @@ jobs:
           cd build
           cmake .. -DENABLE_OPUS_LIBRARY=ON \
             -DENABLE_PORTAUDIO_PLUGIN=OFF \
+            -DENABLE_ASAN=OFF \
             -DCMAKE_INSTALL_PREFIX=/usr \
             -DCMAKE_TOOLCHAIN_FILE=/opt/toolchain/Toolchain.cmake
           make -j6

From 6f1b8c3a4c187d58d1f90a626bc69f5611e59ab5 Mon Sep 17 00:00:00 2001
From: Inho Oh 
Date: Fri, 7 Jan 2022 17:52:12 +0900
Subject: [PATCH 10/19] add release-docker.yaml

Signed-off-by: Inho Oh 
---
 .github/workflows/release-docker.yaml | 98 +++++++++++++++++++++++++++
 .github/workflows/release-ubuntu.yaml | 68 -------------------
 2 files changed, 98 insertions(+), 68 deletions(-)
 create mode 100644 .github/workflows/release-docker.yaml

diff --git a/.github/workflows/release-docker.yaml b/.github/workflows/release-docker.yaml
new file mode 100644
index 0000000000..d669e8698f
--- /dev/null
+++ b/.github/workflows/release-docker.yaml
@@ -0,0 +1,98 @@
+name: Build Docker
+on:
+  page_build:
+  workflow_dispatch:
+    inputs:
+      comment:
+        description: 'Comment'
+        required: false
+        default: ''
+
+env:
+  REPO: nugu-linux
+  REPOSLUG: nugu-developers/nugu-linux
+
+jobs:
+  docker:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check out the repo
+        uses: actions/checkout@v2
+      - name: Generate docker image
+        id: check
+        run: |
+          echo "OS=$OSTYPE"
+
+          function docker_check() {
+            docker pull nugulinux/sdk:unstable
+          }
+
+          if docker_check; then
+            echo "Download success"
+          else
+            echo "Image not exist"
+            echo "::set-output name=commit::x"
+            exit
+          fi
+
+          URL_PACKAGES=https://raw.githubusercontent.com/nugulinux/sdk-unstable/gh-pages/ubuntu/dists/bionic/main/binary-amd64/Packages
+          PKG_VERSION=$(curl -s -X GET $URL_PACKAGES | grep Version | head -1)
+          PKG_SHA=$(echo $PKG_VERSION | sed 's/.*\(.......\)~.*/\1/')
+          echo "Commit from Github pages: $PKG_SHA"
+
+          LAST_COMMIT=`docker run -t --rm nugulinux/sdk:unstable printenv | grep LAST_COMMIT`
+          echo $LAST_COMMIT
+
+          COMMIT=
+          if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+              COMMIT=$(echo $LAST_COMMIT | sed -r 's/LAST_COMMIT=(.*)/\1/' | tr -d '\r')
+          elif [[ "$OSTYPE" == "darwin"* ]]; then
+              COMMIT=$(echo $LAST_COMMIT | gsed -r 's/LAST_COMMIT=(.*)/\1/' | tr -d '\r')
+          fi
+
+          echo "nugulinux/sdk:unstable docker commit='${COMMIT}'"
+
+          if [[ "${COMMIT}" == "${PKG_SHA}" ]]; then
+            echo "Same version"
+            NEED_BUILD=0
+          else
+            echo "not match"
+            NEED_BUILD=1
+          fi
+
+          if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+            echo "force build"
+            NEED_BUILD=1
+          fi
+
+          echo "::set-output name=commit::${COMMIT}"
+          echo "::set-output name=sha::${PKG_SHA}"
+          echo "::set-output name=build::${NEED_BUILD}"
+
+      - name: Information
+        run: |
+          echo "${{ steps.check.outputs.sha }}"
+          echo "${{ steps.check.outputs.commit }}"
+          echo "${{ steps.check.outputs.build }}"
+      - name: Set up QEMU
+        if: ${{ steps.check.outputs.build == 1}}
+        uses: docker/setup-qemu-action@v1
+      - name: Set up Docker Buildx
+        if: ${{ steps.check.outputs.build == 1}}
+        uses: docker/setup-buildx-action@v1
+      - name: Login to GitHub Container Registry
+        if: ${{ steps.check.outputs.build == 1}}
+        uses: docker/login-action@v1
+        with:
+          username: ${{ secrets.DOCKER_USERNAME }}
+          password: ${{ secrets.DOCKER_PASSWORD }}
+      - name: Build and push
+        if: ${{ steps.check.outputs.build == 1}}
+        uses: docker/build-push-action@v2
+        with:
+          context: docker/.
+          platforms: linux/amd64,linux/arm64
+          push: true
+          tags: nugulinux/sdk:unstable
+          build-args: |
+            LAST_COMMIT=${{ steps.check.outputs.sha }}
diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml
index c6b8497c9e..56e090afba 100644
--- a/.github/workflows/release-ubuntu.yaml
+++ b/.github/workflows/release-ubuntu.yaml
@@ -393,71 +393,3 @@ jobs:
           folder: /tmp/www
           clean: true
           single-commit: true
-
-  docker:
-    runs-on: ubuntu-latest
-    needs: [check, build, pages]
-    steps:
-      - name: Check out the repo
-        uses: actions/checkout@v2
-      - name: Generate docker image
-        id: check
-        run: |
-          echo "OS=$OSTYPE"
-
-          function docker_check() {
-            docker pull nugulinux/sdk:unstable
-          }
-
-          if docker_check; then
-            echo "Download success"
-          else
-            echo "Image not exist"
-            echo "::set-output name=commit::x"
-            exit
-          fi
-
-          LAST_COMMIT=`docker run -t --rm nugulinux/sdk:unstable printenv | grep LAST_COMMIT`
-          echo $LAST_COMMIT
-
-          COMMIT=
-          if [[ "$OSTYPE" == "linux-gnu"* ]]; then
-              COMMIT=$(echo $LAST_COMMIT | sed -r 's/LAST_COMMIT=(.*)/\1/' | tr -d '\r')
-          elif [[ "$OSTYPE" == "darwin"* ]]; then
-              COMMIT=$(echo $LAST_COMMIT | gsed -r 's/LAST_COMMIT=(.*)/\1/' | tr -d '\r')
-          fi
-
-          echo "nugulinux/sdk:unstable commit='${COMMIT}'"
-          echo "::set-output name=commit::${COMMIT}"
-
-          if [[ "${COMMIT}" == "${{ needs.check.outputs.sha }}" ]]; then
-            echo "Same version"
-          else
-            echo "not match"
-          fi
-      - name: Information
-        run: |
-          echo "${{ needs.check.outputs.sha }}"
-          echo "${{ steps.check.outputs.commit }}"
-      - name: Set up QEMU
-        if: ${{ steps.check.outputs.commit != needs.check.outputs.sha }}
-        uses: docker/setup-qemu-action@v1
-      - name: Set up Docker Buildx
-        if: ${{ steps.check.outputs.commit != needs.check.outputs.sha }}
-        uses: docker/setup-buildx-action@v1
-      - name: Login to GitHub Container Registry
-        if: ${{ steps.check.outputs.commit != needs.check.outputs.sha }}
-        uses: docker/login-action@v1
-        with:
-          username: ${{ secrets.DOCKER_USERNAME }}
-          password: ${{ secrets.DOCKER_PASSWORD }}
-      - name: Build and push
-        if: ${{ steps.check.outputs.commit != needs.check.outputs.sha }}
-        uses: docker/build-push-action@v2
-        with:
-          context: docker/.
-          platforms: linux/amd64,linux/arm64
-          push: true
-          tags: nugulinux/sdk:unstable
-          build-args: |
-            LAST_COMMIT=${{ needs.check.outputs.sha }}

From 1f6c3c85d56cf185169591bd98f704197bd375d8 Mon Sep 17 00:00:00 2001
From: Inho Oh 
Date: Fri, 27 May 2022 17:20:39 +0900
Subject: [PATCH 11/19] fix release-allwinner.yaml to turn off ASAN option

Signed-off-by: Inho Oh 
---
 .github/workflows/release-allwinner.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/release-allwinner.yaml b/.github/workflows/release-allwinner.yaml
index 1072f8910b..06ac139acd 100644
--- a/.github/workflows/release-allwinner.yaml
+++ b/.github/workflows/release-allwinner.yaml
@@ -96,6 +96,7 @@ jobs:
           cd build
 
           cmake .. \
+              -DENABLE_ASAN=OFF \
               -DCMAKE_INSTALL_PREFIX=/mnt/UDISK \
               -DCMAKE_INSTALL_LIBDIR=/mnt/UDISK/lib \
               -DCMAKE_TOOLCHAIN_FILE=/opt/toolchain/Toolchain.cmake

From 50f0a800edc380f35a9963cfd7ca48190c51c1b0 Mon Sep 17 00:00:00 2001
From: Inho Oh 
Date: Mon, 30 May 2022 21:00:24 +0900
Subject: [PATCH 12/19] add 22.04(jammy) support

add Ubuntu 22.04(jammy) support

Signed-off-by: Inho Oh 
---
 .github/workflows/release-ubuntu.yaml | 38 ++++++++++++++++++++++++---
 README.md                             |  4 +++
 2 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml
index 56e090afba..dcb645c986 100644
--- a/.github/workflows/release-ubuntu.yaml
+++ b/.github/workflows/release-ubuntu.yaml
@@ -65,6 +65,9 @@ jobs:
             focal_x64,
             focal_arm64,
             focal_armhf,
+            jammy_x64,
+            jammy_arm64,
+            jammy_armhf,
           ]
     steps:
       - name: Setup
@@ -105,7 +108,7 @@ jobs:
               continue;
             fi
 
-            # Check Ubuntu version (focal / bionic / xenial)
+            # Check Ubuntu version (jammy / focal / bionic / xenial)
             if [[ $item == *"${{ steps.setup.outputs.ubuntuver }}"* ]]; then
               :
             else
@@ -152,9 +155,11 @@ jobs:
           sed -i "1 s/ubuntu[0-9]*~xenial/ubuntu${VERSION}~xenial/" packaging/xenial/changelog
           sed -i "1 s/ubuntu[0-9]*~bionic/ubuntu${VERSION}~bionic/" packaging/bionic/changelog
           sed -i "1 s/ubuntu[0-9]*~focal/ubuntu${VERSION}~focal/" packaging/focal/changelog
+          sed -i "1 s/ubuntu[0-9]*~jammy/ubuntu${VERSION}~jammy/" packaging/jammy/changelog
           head -1 packaging/xenial/changelog
           head -1 packaging/bionic/changelog
           head -1 packaging/focal/changelog
+          head -1 packaging/jammy/changelog
           cd -
 
           # Fix permissions for docker
@@ -190,7 +195,13 @@ jobs:
           do
             echo "Extract ${item}"
             ar x ${item}
-            tar -C dest -xvf data.tar.xz
+            if [ -f data.tar.xz ];  then
+              tar -C dest -xvf data.tar.xz
+              rm data.tar.xz
+            elif [ -f data.tar.zst ];  then
+              tar -C dest -xvf data.tar.zst
+              rm data.tar.zst
+            fi
           done
 
           # Generate tgz
@@ -226,11 +237,12 @@ jobs:
           POOL_XENIAL=${BASEROOT}/ubuntu/dists/xenial/pool
           POOL_BIONIC=${BASEROOT}/ubuntu/dists/bionic/pool
           POOL_FOCAL=${BASEROOT}/ubuntu/dists/focal/pool
+          POOL_JAMMY=${BASEROOT}/ubuntu/dists/jammy/pool
 
           DIRS=(
               ${POOL_XENIAL}
               ${POOL_BIONIC}
-              ${POOL_FOCAL}
+              ${POOL_JAMMY}
               ${BASEROOT}/ubuntu/dists/xenial/main/binary-amd64
               ${BASEROOT}/ubuntu/dists/xenial/main/binary-arm64
               ${BASEROOT}/ubuntu/dists/xenial/main/binary-armhf
@@ -240,6 +252,9 @@ jobs:
               ${BASEROOT}/ubuntu/dists/focal/main/binary-amd64
               ${BASEROOT}/ubuntu/dists/focal/main/binary-arm64
               ${BASEROOT}/ubuntu/dists/focal/main/binary-armhf
+              ${BASEROOT}/ubuntu/dists/jammy/main/binary-amd64
+              ${BASEROOT}/ubuntu/dists/jammy/main/binary-arm64
+              ${BASEROOT}/ubuntu/dists/jammy/main/binary-armhf
           )
 
           for item in "${DIRS[@]}"
@@ -277,6 +292,12 @@ jobs:
 
           

Unstable package repository setup

+

Jammy (22.04)

+
+              echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ jammy main" > /etc/apt/sources.list.d/nugudev.list
+              apt-get update
+          
+

Focal (20.04)

               echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ focal main" > /etc/apt/sources.list.d/nugudev.list
@@ -308,6 +329,7 @@ jobs:
           echo "::set-output name=pool_xenial::${POOL_XENIAL}"
           echo "::set-output name=pool_bionic::${POOL_BIONIC}"
           echo "::set-output name=pool_focal::${POOL_FOCAL}"
+          echo "::set-output name=pool_jammy::${POOL_JAMMY}"
 
       - name: Generate doxygen
         run: |
@@ -380,6 +402,16 @@ jobs:
               elif [[ $item == *"arm64"* ]]; then
                 generate "focal" "arm64"
               fi
+            elif [[ $item == *"jammy"* ]]; then
+              echo "- 20.04: ${item}"
+              wget -nv ${item} -P ${{ steps.setup.outputs.pool_jammy }}
+              if [[ $item == *"amd64"* ]]; then
+                generate "jammy" "amd64"
+              elif [[ $item == *"armhf"* ]]; then
+                generate "jammy" "armhf"
+              elif [[ $item == *"arm64"* ]]; then
+                generate "jammy" "arm64"
+              fi
             else
               echo "- unknown version: ${item}"
             fi
diff --git a/README.md b/README.md
index c7dd9b5be3..1aedc32b74 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,10 @@ Ubuntu 20.04:
 
     deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ focal main
 
+Ubuntu 22.04:
+
+    deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ jammy main
+
 Update the package information
 
     sudo apt-get update

From 370c1f752efa015ce1fa5d608fca50b139bd5590 Mon Sep 17 00:00:00 2001
From: "Hyungrok.Kim" 
Date: Thu, 16 Jun 2022 15:44:20 +0900
Subject: [PATCH 13/19] build: remove xenial(16.04) target

It remove the xenial build target from github workflows.

Signed-off-by: Hyungrok.Kim 
---
 .github/workflows/release-ubuntu.yaml | 31 ++-------------------------
 README.md                             |  4 ----
 2 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml
index dcb645c986..91c403a508 100644
--- a/.github/workflows/release-ubuntu.yaml
+++ b/.github/workflows/release-ubuntu.yaml
@@ -56,9 +56,6 @@ jobs:
       matrix:
         target:
           [
-            xenial_x64,
-            xenial_arm64,
-            xenial_armhf,
             bionic_x64,
             bionic_arm64,
             bionic_armhf,
@@ -108,7 +105,7 @@ jobs:
               continue;
             fi
 
-            # Check Ubuntu version (jammy / focal / bionic / xenial)
+            # Check Ubuntu version (jammy / focal / bionic)
             if [[ $item == *"${{ steps.setup.outputs.ubuntuver }}"* ]]; then
               :
             else
@@ -152,11 +149,9 @@ jobs:
           rm -rf .git
 
           echo "Add commit-id(${{ steps.setup.outputs.sha }}) to package version"
-          sed -i "1 s/ubuntu[0-9]*~xenial/ubuntu${VERSION}~xenial/" packaging/xenial/changelog
           sed -i "1 s/ubuntu[0-9]*~bionic/ubuntu${VERSION}~bionic/" packaging/bionic/changelog
           sed -i "1 s/ubuntu[0-9]*~focal/ubuntu${VERSION}~focal/" packaging/focal/changelog
           sed -i "1 s/ubuntu[0-9]*~jammy/ubuntu${VERSION}~jammy/" packaging/jammy/changelog
-          head -1 packaging/xenial/changelog
           head -1 packaging/bionic/changelog
           head -1 packaging/focal/changelog
           head -1 packaging/jammy/changelog
@@ -234,18 +229,13 @@ jobs:
         run: |
           sudo apt-get install doxygen graphviz
 
-          POOL_XENIAL=${BASEROOT}/ubuntu/dists/xenial/pool
           POOL_BIONIC=${BASEROOT}/ubuntu/dists/bionic/pool
           POOL_FOCAL=${BASEROOT}/ubuntu/dists/focal/pool
           POOL_JAMMY=${BASEROOT}/ubuntu/dists/jammy/pool
 
           DIRS=(
-              ${POOL_XENIAL}
               ${POOL_BIONIC}
               ${POOL_JAMMY}
-              ${BASEROOT}/ubuntu/dists/xenial/main/binary-amd64
-              ${BASEROOT}/ubuntu/dists/xenial/main/binary-arm64
-              ${BASEROOT}/ubuntu/dists/xenial/main/binary-armhf
               ${BASEROOT}/ubuntu/dists/bionic/main/binary-amd64
               ${BASEROOT}/ubuntu/dists/bionic/main/binary-arm64
               ${BASEROOT}/ubuntu/dists/bionic/main/binary-armhf
@@ -310,12 +300,6 @@ jobs:
               apt-get update
           
-

Xenial (16.04)

-
-              echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ xenial main" > /etc/apt/sources.list.d/nugudev.list
-              apt-get update
-          
-

Generated at ${DATE}

@@ -326,7 +310,6 @@ jobs: echo "::set-output name=id::${{ needs.check.outputs.release_id }}" echo "::set-output name=sha::${{ needs.check.outputs.sha }}" - echo "::set-output name=pool_xenial::${POOL_XENIAL}" echo "::set-output name=pool_bionic::${POOL_BIONIC}" echo "::set-output name=pool_focal::${POOL_FOCAL}" echo "::set-output name=pool_jammy::${POOL_JAMMY}" @@ -372,17 +355,7 @@ jobs: echo "Download ${item}" - if [[ $item == *"xenial"* ]]; then - echo "- 16.04: ${item}" - wget -nv ${item} -P ${{ steps.setup.outputs.pool_xenial }} - if [[ $item == *"amd64"* ]]; then - generate "xenial" "amd64" - elif [[ $item == *"armhf"* ]]; then - generate "xenial" "armhf" - elif [[ $item == *"arm64"* ]]; then - generate "xenial" "arm64" - fi - elif [[ $item == *"bionic"* ]]; then + if [[ $item == *"bionic"* ]]; then echo "- 18.04: ${item}" wget -nv ${item} -P ${{ steps.setup.outputs.pool_bionic }} if [[ $item == *"amd64"* ]]; then diff --git a/README.md b/README.md index 1aedc32b74..38e6dd6b96 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,6 @@ Add NUGU SDK for Linux PPA: Create a `/etc/apt/sources.list.d/nugu-unstable.list` file with following content. -Ubuntu 16.04: - - deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ xenial main - Ubuntu 18.04: deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ bionic main From e6beb468ec01f7e8260cdd7ad0a69293fb149c39 Mon Sep 17 00:00:00 2001 From: "Hyungrok.Kim" Date: Wed, 22 Jun 2022 14:11:16 +0900 Subject: [PATCH 14/19] build:update docker ubuntu target It update the docker ubuntu target from bionic to focal. Signed-off-by: Hyungrok.Kim --- .github/workflows/release-docker.yaml | 2 +- docker/Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-docker.yaml b/.github/workflows/release-docker.yaml index d669e8698f..01b5f76ddd 100644 --- a/.github/workflows/release-docker.yaml +++ b/.github/workflows/release-docker.yaml @@ -35,7 +35,7 @@ jobs: exit fi - URL_PACKAGES=https://raw.githubusercontent.com/nugulinux/sdk-unstable/gh-pages/ubuntu/dists/bionic/main/binary-amd64/Packages + URL_PACKAGES=https://raw.githubusercontent.com/nugulinux/sdk-unstable/gh-pages/ubuntu/dists/focal/main/binary-amd64/Packages PKG_VERSION=$(curl -s -X GET $URL_PACKAGES | grep Version | head -1) PKG_SHA=$(echo $PKG_VERSION | sed 's/.*\(.......\)~.*/\1/') echo "Commit from Github pages: $PKG_SHA" diff --git a/docker/Dockerfile b/docker/Dockerfile index 928dece651..7146e20cb6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:bionic +FROM ubuntu:focal LABEL maintainer="nugulinux@gmail.com" \ version="0.1" \ description="nugulinux unstable sdk" @@ -15,7 +15,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN apt-get update && apt-get install -y software-properties-common ca-certificates --no-install-recommends \ && add-apt-repository -y ppa:nugulinux/sdk \ - && echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ bionic main" > /etc/apt/sources.list.d/nugu-unstable.list \ + && echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ focal main" > /etc/apt/sources.list.d/nugu-unstable.list \ && apt-get update && apt-get install -y --no-install-recommends \ gstreamer1.0-pulseaudio \ libnugu \ From 252e5668c6d87dac9d762704fd19d54ec868ecd9 Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Thu, 29 Sep 2022 10:44:54 +0900 Subject: [PATCH 15/19] build: fix option name for OPUS CMake option name for OPUS is changed `ENABLE_OPUS_LIBRARY` to `ENABLE_BUILTIN_OPUS`. Signed-off-by: Inho Oh --- .github/workflows/release-agl.yaml | 2 +- .github/workflows/release-tizen.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-agl.yaml b/.github/workflows/release-agl.yaml index bed8d6397d..f752691f0e 100644 --- a/.github/workflows/release-agl.yaml +++ b/.github/workflows/release-agl.yaml @@ -123,7 +123,7 @@ jobs: rm -rf build mkdir build cd build - cmake .. -DENABLE_OPUS_LIBRARY=ON \ + cmake .. -DENABLE_BUILTIN_OPUS=ON \ -DENABLE_PORTAUDIO_PLUGIN=OFF \ -DENABLE_ASAN=OFF \ -DCMAKE_INSTALL_PREFIX=/usr \ diff --git a/.github/workflows/release-tizen.yaml b/.github/workflows/release-tizen.yaml index 6d029dff1f..733ec61c00 100644 --- a/.github/workflows/release-tizen.yaml +++ b/.github/workflows/release-tizen.yaml @@ -141,7 +141,7 @@ jobs: -DENABLE_GSTREAMER_PLUGIN=OFF \ -DENABLE_PORTAUDIO_PLUGIN=OFF \ -DENABLE_VENDOR_LIBRARY=ON \ - -DENABLE_OPUS_LIBRARY=ON + -DENABLE_BUILTIN_OPUS=ON make -j6 From d70a64bcb7027b4f66e57078c8eb319ee11fcd51 Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Tue, 18 Oct 2022 16:19:18 +0900 Subject: [PATCH 16/19] build: update action version Node.js v12 is deprecated in Github action. So need to update related Github actions. Signed-off-by: Inho Oh --- .github/workflows/release-CHANGES.yaml | 2 +- .github/workflows/release-agl.yaml | 2 +- .github/workflows/release-allwinner.yaml | 2 +- .github/workflows/release-docker.yaml | 10 +++++----- .github/workflows/release-tizen.yaml | 2 +- .github/workflows/release-ubuntu.yaml | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-CHANGES.yaml b/.github/workflows/release-CHANGES.yaml index b0725f1cfc..9d474332f0 100644 --- a/.github/workflows/release-CHANGES.yaml +++ b/.github/workflows/release-CHANGES.yaml @@ -27,7 +27,7 @@ jobs: cat CHANGES.txt - name: Upload - uses: svenstaro/upload-release-action@2.2.0 + uses: svenstaro/upload-release-action@v2 with: file: CHANGES.txt repo_token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/release-agl.yaml b/.github/workflows/release-agl.yaml index f752691f0e..65159c0449 100644 --- a/.github/workflows/release-agl.yaml +++ b/.github/workflows/release-agl.yaml @@ -145,7 +145,7 @@ jobs: - name: Upload if: ${{ steps.dupcheck.outputs.exist == '0'}} - uses: svenstaro/upload-release-action@2.2.0 + uses: svenstaro/upload-release-action@v2 with: file: /tmp/*.tgz file_glob: true diff --git a/.github/workflows/release-allwinner.yaml b/.github/workflows/release-allwinner.yaml index 06ac139acd..f9ab346763 100644 --- a/.github/workflows/release-allwinner.yaml +++ b/.github/workflows/release-allwinner.yaml @@ -121,7 +121,7 @@ jobs: - name: Upload if: ${{ steps.dupcheck.outputs.exist == '0'}} - uses: svenstaro/upload-release-action@2.2.0 + uses: svenstaro/upload-release-action@v2 with: file: /tmp/result/* file_glob: true diff --git a/.github/workflows/release-docker.yaml b/.github/workflows/release-docker.yaml index 01b5f76ddd..08135895f8 100644 --- a/.github/workflows/release-docker.yaml +++ b/.github/workflows/release-docker.yaml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate docker image id: check run: | @@ -76,19 +76,19 @@ jobs: echo "${{ steps.check.outputs.build }}" - name: Set up QEMU if: ${{ steps.check.outputs.build == 1}} - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx if: ${{ steps.check.outputs.build == 1}} - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry if: ${{ steps.check.outputs.build == 1}} - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push if: ${{ steps.check.outputs.build == 1}} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: context: docker/. platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/release-tizen.yaml b/.github/workflows/release-tizen.yaml index 733ec61c00..a90c8c3fa9 100644 --- a/.github/workflows/release-tizen.yaml +++ b/.github/workflows/release-tizen.yaml @@ -166,7 +166,7 @@ jobs: - name: Upload if: ${{ steps.check.outputs.exist == '0'}} - uses: svenstaro/upload-release-action@2.2.0 + uses: svenstaro/upload-release-action@v2 with: file: /tmp/result/* file_glob: true diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml index 91c403a508..2cc2fc1d26 100644 --- a/.github/workflows/release-ubuntu.yaml +++ b/.github/workflows/release-ubuntu.yaml @@ -208,7 +208,7 @@ jobs: - name: Upload artifact to release if: ${{ steps.build.outputs.files == '1'}} - uses: svenstaro/upload-release-action@2.2.0 + uses: svenstaro/upload-release-action@v2 with: file: /tmp/result/* file_glob: true @@ -223,7 +223,7 @@ jobs: BASEROOT: /tmp/www steps: - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup id: setup run: | @@ -391,7 +391,7 @@ jobs: done - name: Deploy to Github Pages - uses: JamesIves/github-pages-deploy-action@4.1.5 + uses: JamesIves/github-pages-deploy-action@v4 with: token: ${{ secrets.GH_TOKEN }} branch: gh-pages From ec5ebc8a3434783c2d2df232145fccd6e4dfa3c1 Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Tue, 18 Oct 2022 16:40:30 +0900 Subject: [PATCH 17/19] build: update action version Node.js v12 is deprecated in Github action. So need to update related Github actions. Signed-off-by: Inho Oh --- .github/workflows/generate-release.yaml | 30 +++++----- .github/workflows/release-agl.yaml | 26 ++++----- .github/workflows/release-allwinner.yaml | 22 ++++---- .github/workflows/release-docker.yaml | 25 ++++----- .github/workflows/release-tizen.yaml | 26 ++++----- .github/workflows/release-ubuntu.yaml | 71 ++++++++++++------------ 6 files changed, 95 insertions(+), 105 deletions(-) diff --git a/.github/workflows/generate-release.yaml b/.github/workflows/generate-release.yaml index d2a2394c54..7352a87f31 100644 --- a/.github/workflows/generate-release.yaml +++ b/.github/workflows/generate-release.yaml @@ -15,7 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Get last commit from nugu-developers/nugu-linux - id: get-commit env: GITHUB_EVENT: ${{ toJson(github.event) }} run: | @@ -32,34 +31,35 @@ jobs: echo "SHA=$SHA" echo "SHORTSHA=$SHORTSHA" echo "MSG=$MSG" - echo "::set-output name=sha::$SHA" - echo "::set-output name=shortsha::$SHORTSHA" - echo "::set-output name=body::$MSG" + echo "sha=$SHA" >> $GITHUB_ENV + echo "shortsha=$SHORTSHA" >> $GITHUB_ENV + echo "body<> $GITHUB_ENV + echo "$MSG" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV - - name: Check existing release for ${{ steps.get-commit.outputs.shortsha }} - id: last-release + - name: Check existing release for ${{ env.shortsha }} run: | - echo "SHA=${{ steps.get-commit.outputs.sha }}" - ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${{ steps.get-commit.outputs.shortsha }} | jq '.id' -r) + echo "SHA=${{ env.sha }}" + ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${{ env.shortsha }} | jq '.id' -r) echo "> Release ID = ${ID}" if [[ ${ID} != "null" ]]; then echo "Release ${ID} is already exist" - echo "::set-output name=exist::1" + echo "exist=1" >> $GITHUB_ENV else echo "Release ${ID} is not exist." - echo "::set-output name=exist::0" + echo "exist=0" >> $GITHUB_ENV fi - name: Done - if: ${{ steps.last-release.outputs.exist == '1'}} + if: ${{ env.exist == '1'}} run: echo "Done" - name: Generate new release - if: ${{ steps.last-release.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} run: | - jq -n --arg body "${{ steps.get-commit.outputs.body }}" \ - --arg tag_name "${{ steps.get-commit.outputs.shortsha }}" \ - --arg name "${{ steps.get-commit.outputs.shortsha }}" \ + jq -n --arg body "${{ env.body }}" \ + --arg tag_name "${{ env.shortsha }}" \ + --arg name "${{ env.shortsha }}" \ '{ "tag_name": $tag_name, "name": $name, "body": $body }' | curl -D - \ -H "Authorization: token ${{ secrets.GH_TOKEN }}" \ -X POST https://api.github.com/repos/${GITHUB_REPOSITORY}/releases -d@- diff --git a/.github/workflows/release-agl.yaml b/.github/workflows/release-agl.yaml index 65159c0449..f08a339d86 100644 --- a/.github/workflows/release-agl.yaml +++ b/.github/workflows/release-agl.yaml @@ -34,7 +34,6 @@ jobs: target: [ koi_rpi4, koi_x64 ] steps: - name: Get SHA and ID from Release ${{ github.ref }} - id: check run: | if [ -z "${{ github.event.inputs.hash }}" ]; then # Remove "refs/tags/" from "refs/tags/xxxxxxx" @@ -53,15 +52,14 @@ jobs: fi echo "Release-ID: $ID" - echo "::set-output name=id::$ID" - echo "::set-output name=sha::$SHORTSHA" + echo "id=$ID" >> $GITHUB_ENV + echo "sha=$SHORTSHA" >> $GITHUB_ENV - name: Check for duplicated files - id: dupcheck run: | COUNT=0 MATCH_COUNT=1 - RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.check.outputs.id }}/assets?per_page=80) + RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ env.id }}/assets?per_page=80) FILES=$(echo $RESULT | jq '.[].name' -r) for item in $FILES @@ -81,22 +79,22 @@ jobs: # Mark to flag file to trigger the build if [[ $COUNT == $MATCH_COUNT ]]; then echo "> There is no need to rebuild." - echo "::set-output name=exist::1" + echo "exist=1" >> $GITHUB_ENV else echo "> Rebuild required" - echo "::set-output name=exist::0" + echo "exist=0" >> $GITHUB_ENV fi - name: The build artifact already exists, so the build is skipped. - if: ${{ steps.dupcheck.outputs.exist == '1'}} + if: ${{ env.exist == '1'}} run: echo "Done" - name: Prepare SDK source - if: ${{ steps.dupcheck.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} run: | git clone https://github.com/${REPOSLUG} --recursive cd ${REPO} - git checkout ${{ steps.check.outputs.sha }} + git checkout ${{ env.sha }} git reset --hard rm -rf .git @@ -106,11 +104,11 @@ jobs: ls -l - name: Prepare AGL Docker image - if: ${{ steps.dupcheck.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} run: docker pull ghcr.io/webispy/agl:${{ matrix.target }} - name: Build - if: ${{ steps.dupcheck.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} run: | cd ${REPO} @@ -132,7 +130,7 @@ jobs: mkdir SDK DESTDIR=SDK make install - tar cvfz files_agl_${{ matrix.target }}_${{ steps.check.outputs.sha }}.tgz SDK + tar cvfz files_agl_${{ matrix.target }}_${{ env.sha }}.tgz SDK EOF chmod 755 sdkbuild.sh @@ -144,7 +142,7 @@ jobs: cp build/files_*.tgz /tmp/ - name: Upload - if: ${{ steps.dupcheck.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} uses: svenstaro/upload-release-action@v2 with: file: /tmp/*.tgz diff --git a/.github/workflows/release-allwinner.yaml b/.github/workflows/release-allwinner.yaml index f9ab346763..b140f9f33c 100644 --- a/.github/workflows/release-allwinner.yaml +++ b/.github/workflows/release-allwinner.yaml @@ -20,7 +20,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Get SHA and ID from Release ${{ github.ref }} - id: check run: | # Remove "refs/tags/" from "refs/tags/xxxxxxx" SHORTSHA=$(echo ${GITHUB_REF} | cut -c11-) @@ -35,15 +34,14 @@ jobs: fi echo "Release-ID: $ID" - echo "::set-output name=id::$ID" - echo "::set-output name=sha::$SHORTSHA" + echo "id=$ID" >> $GITHUB_ENV + echo "sha=$SHORTSHA" >> $GITHUB_ENV - name: Check for duplicated files - id: dupcheck run: | COUNT=0 MATCH_COUNT=1 - RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.check.outputs.id }}/assets?per_page=80) + RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ env.id }}/assets?per_page=80) FILES=$(echo $RESULT | jq '.[].name' -r) for item in $FILES @@ -63,22 +61,22 @@ jobs: # Mark to flag file to trigger the build if [[ $COUNT == $MATCH_COUNT ]]; then echo "> There is no need to rebuild." - echo "::set-output name=exist::1" + echo "exist=1" >> $GITHUB_ENV else echo "> Rebuild required" - echo "::set-output name=exist::0" + echo "exist=0" >> $GITHUB_ENV fi - name: The build artifact already exists, so the build is skipped. - if: ${{ steps.dupcheck.outputs.exist == '1'}} + if: ${{ env.exist == '1'}} run: echo "Done" - name: Build - if: ${{ steps.dupcheck.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} run: | git clone https://github.com/${REPOSLUG} --recursive cd ${REPO} - git checkout ${{ steps.check.outputs.sha }} + git checkout ${{ env.sha }} git reset --hard rm -rf .git @@ -103,7 +101,7 @@ jobs: make -j6 make install mv /mnt/UDISK ./SDK - tar cvfz files_allwinner_${{ steps.check.outputs.sha }}.tgz SDK + tar cvfz files_allwinner_${{ env.sha }}.tgz SDK EOF chmod 755 sdkbuild.sh @@ -120,7 +118,7 @@ jobs: ls -l - name: Upload - if: ${{ steps.dupcheck.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} uses: svenstaro/upload-release-action@v2 with: file: /tmp/result/* diff --git a/.github/workflows/release-docker.yaml b/.github/workflows/release-docker.yaml index 08135895f8..85dc9a1003 100644 --- a/.github/workflows/release-docker.yaml +++ b/.github/workflows/release-docker.yaml @@ -19,7 +19,6 @@ jobs: - name: Check out the repo uses: actions/checkout@v3 - name: Generate docker image - id: check run: | echo "OS=$OSTYPE" @@ -31,7 +30,7 @@ jobs: echo "Download success" else echo "Image not exist" - echo "::set-output name=commit::x" + echo "commit=x" >> $GITHUB_ENV exit fi @@ -65,29 +64,29 @@ jobs: NEED_BUILD=1 fi - echo "::set-output name=commit::${COMMIT}" - echo "::set-output name=sha::${PKG_SHA}" - echo "::set-output name=build::${NEED_BUILD}" + echo "commit=${COMMIT}" >> $GITHUB_ENV + echo "sha=${PKG_SHA}" >> $GITHUB_ENV + echo "build=${NEED_BUILD}" >> $GITHUB_ENV - name: Information run: | - echo "${{ steps.check.outputs.sha }}" - echo "${{ steps.check.outputs.commit }}" - echo "${{ steps.check.outputs.build }}" + echo "${{ env.sha }}" + echo "${{ env.commit }}" + echo "${{ env.build }}" - name: Set up QEMU - if: ${{ steps.check.outputs.build == 1}} + if: ${{ env.build == 1}} uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - if: ${{ steps.check.outputs.build == 1}} + if: ${{ env.build == 1}} uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry - if: ${{ steps.check.outputs.build == 1}} + if: ${{ env.build == 1}} uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push - if: ${{ steps.check.outputs.build == 1}} + if: ${{ env.build == 1}} uses: docker/build-push-action@v3 with: context: docker/. @@ -95,4 +94,4 @@ jobs: push: true tags: nugulinux/sdk:unstable build-args: | - LAST_COMMIT=${{ steps.check.outputs.sha }} + LAST_COMMIT=${{ env.sha }} diff --git a/.github/workflows/release-tizen.yaml b/.github/workflows/release-tizen.yaml index a90c8c3fa9..d2dc5c83d2 100644 --- a/.github/workflows/release-tizen.yaml +++ b/.github/workflows/release-tizen.yaml @@ -45,8 +45,8 @@ jobs: fi echo "Release-ID: $ID" - echo "::set-output name=id::$ID" - echo "::set-output name=sha::$SHORTSHA" + echo "id=$ID" >> $GITHUB_OUTPUT + echo "sha=$SHORTSHA" >> $GITHUB_OUTPUT build: runs-on: ubuntu-latest @@ -57,17 +57,15 @@ jobs: target: [emulator, device] steps: - name: Setup - id: setup run: | - echo "::set-output name=id::${{ needs.check.outputs.release_id }}" - echo "::set-output name=sha::${{ needs.check.outputs.sha }}" + echo "id=${{ needs.check.outputs.release_id }}" >> $GITHUB_ENV + echo "sha=${{ needs.check.outputs.sha }}" >> $GITHUB_ENV - name: Check for duplicated files - id: check run: | COUNT=0 MATCH_COUNT=1 - RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=80) + RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ env.id }}/assets?per_page=80) FILES=$(echo $RESULT | jq '.[].name' -r) for item in $FILES @@ -93,22 +91,22 @@ jobs: # Mark to flag file to trigger the build if [[ $COUNT == $MATCH_COUNT ]]; then echo "> There is no need to rebuild." - echo "::set-output name=exist::1" + echo "exist=1" >> $GITHUB_ENV else echo "> Rebuild required" - echo "::set-output name=exist::0" + echo "exist=0" >> $GITHUB_ENV fi - name: The build artifact already exists, so the build is skipped. - if: ${{ steps.check.outputs.exist == '1'}} + if: ${{ env.exist == '1'}} run: echo "Done" - name: Build - if: ${{ steps.check.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} run: | git clone https://github.com/${REPOSLUG} --recursive cd ${REPO} - git checkout ${{ steps.setup.outputs.sha }} + git checkout ${{ env.sha }} git reset --hard rm -rf .git @@ -148,7 +146,7 @@ jobs: DESTDIR=$SDKPATH make install cd .. - tar cvfz files_tizen_${{ matrix.target }}_${{ steps.setup.outputs.sha }}.tgz SDK + tar cvfz files_tizen_${{ matrix.target }}_${{ env.sha }}.tgz SDK EOF chmod 755 sdkbuild.sh @@ -165,7 +163,7 @@ jobs: ls -l - name: Upload - if: ${{ steps.check.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} uses: svenstaro/upload-release-action@v2 with: file: /tmp/result/* diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml index 2cc2fc1d26..baf15b5a35 100644 --- a/.github/workflows/release-ubuntu.yaml +++ b/.github/workflows/release-ubuntu.yaml @@ -45,8 +45,8 @@ jobs: fi echo "Release-ID: $ID" - echo "::set-output name=id::$ID" - echo "::set-output name=sha::$SHORTSHA" + echo "id=$ID" >> $GITHUB_OUTPUT + echo "sha=$SHORTSHA" >> $GITHUB_OUTPUT build: runs-on: ubuntu-latest @@ -68,7 +68,6 @@ jobs: ] steps: - name: Setup - id: setup run: | UBUNTU_VER=$(echo ${{ matrix.target }} | cut -d "_" -f 1) ARCH=$(echo ${{ matrix.target }} | cut -d "_" -f 2) @@ -78,18 +77,17 @@ jobs: ARCH2="${ARCH}" fi - echo "::set-output name=ubuntuver::$UBUNTU_VER" - echo "::set-output name=arch::$ARCH" - echo "::set-output name=arch2::$ARCH2" - echo "::set-output name=id::${{ needs.check.outputs.release_id }}" - echo "::set-output name=sha::${{ needs.check.outputs.sha }}" + echo "ubuntuver=$UBUNTU_VER" >> $GITHUB_ENV + echo "arch=$ARCH" >> $GITHUB_ENV + echo "arch2=$ARCH2" >> $GITHUB_ENV + echo "id=${{ needs.check.outputs.release_id }}" >> $GITHUB_ENV + echo "sha=${{ needs.check.outputs.sha }}" >> $GITHUB_ENV - name: Check for duplicated files - id: check run: | COUNT=0 MATCH_COUNT=6 - RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=80) + RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ env.id }}/assets?per_page=80) FILES=$(echo $RESULT | jq '.[].name' -r) for item in $FILES @@ -97,16 +95,16 @@ jobs: echo "Check artifacts - $item" # Check ARCH or ARCH2 - if [[ $item == *"${{ steps.setup.outputs.arch }}"* ]]; then + if [[ $item == *"${{ env.arch }}"* ]]; then : - elif [[ $item == *"${{ steps.setup.outputs.arch2 }}"* ]]; then + elif [[ $item == *"${{ env.arch2 }}"* ]]; then : else continue; fi # Check Ubuntu version (jammy / focal / bionic) - if [[ $item == *"${{ steps.setup.outputs.ubuntuver }}"* ]]; then + if [[ $item == *"${{ env.ubuntuver }}"* ]]; then : else continue; @@ -119,36 +117,35 @@ jobs: # Mark to flag file to trigger the build if [[ $COUNT == $MATCH_COUNT ]]; then echo "> There is no need to rebuild." - echo "::set-output name=exist::1" + echo "exist=1" >> $GITHUB_ENV else echo "> Rebuild required" - echo "::set-output name=exist::0" + echo "exist=0" >> $GITHUB_ENV fi - name: The build artifact already exists, so the build is skipped. - if: ${{ steps.check.outputs.exist == '1'}} + if: ${{ env.exist == '1'}} run: echo "Done" - name: Start Ubuntu build - id: build - if: ${{ steps.check.outputs.exist == '0'}} + if: ${{ env.exist == '0'}} run: | # Get date for commit to generate version - DATETIME=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${REPOSLUG}/commits/${{ steps.setup.outputs.sha }} | jq '.commit.committer.date' -r) + DATETIME=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${REPOSLUG}/commits/${{ env.sha }} | jq '.commit.committer.date' -r) echo "commit.committer.date = ${DATETIME}" STAMP=$(date -d ${DATETIME} +%Y%m%d) - VERSION="${STAMP}${{ steps.setup.outputs.sha }}" + VERSION="${STAMP}${{ env.sha }}" echo "package version = ${VERSION}" echo "Clone the sdk repository" git clone https://github.com/${REPOSLUG} --recursive cd ${REPO} - git checkout ${{ steps.setup.outputs.sha }} + git checkout ${{ env.sha }} git reset --hard rm -rf .git - echo "Add commit-id(${{ steps.setup.outputs.sha }}) to package version" + echo "Add commit-id(${{ env.sha }}) to package version" sed -i "1 s/ubuntu[0-9]*~bionic/ubuntu${VERSION}~bionic/" packaging/bionic/changelog sed -i "1 s/ubuntu[0-9]*~focal/ubuntu${VERSION}~focal/" packaging/focal/changelog sed -i "1 s/ubuntu[0-9]*~jammy/ubuntu${VERSION}~jammy/" packaging/jammy/changelog @@ -174,12 +171,12 @@ jobs: cp *.deb /tmp/result/ echo "Completed" - echo "::set-output name=files::1" + echo "files=1" >> $GITHUB_ENV - name: Generate tgz - if: ${{ steps.build.outputs.files == '1'}} + if: ${{ env.files == '1'}} run: | - FILENAME=files_${{ matrix.target }}_${{ steps.setup.outputs.sha }} + FILENAME=files_${{ matrix.target }}_${{ env.sha }} # Create temporary directory mkdir dest @@ -207,7 +204,7 @@ jobs: cp ${FILENAME}.tgz /tmp/result/ - name: Upload artifact to release - if: ${{ steps.build.outputs.files == '1'}} + if: ${{ env.files == '1'}} uses: svenstaro/upload-release-action@v2 with: file: /tmp/result/* @@ -263,7 +260,7 @@ jobs:

DEB Package repository for unstable release

- last unstable commit: ${{ steps.setup.outputs.sha }} + last unstable commit: ${{ env.sha }}

@@ -308,17 +305,17 @@ jobs: EOF - echo "::set-output name=id::${{ needs.check.outputs.release_id }}" - echo "::set-output name=sha::${{ needs.check.outputs.sha }}" - echo "::set-output name=pool_bionic::${POOL_BIONIC}" - echo "::set-output name=pool_focal::${POOL_FOCAL}" - echo "::set-output name=pool_jammy::${POOL_JAMMY}" + echo "id=${{ needs.check.outputs.release_id }}" >> $GITHUB_ENV + echo "sha=${{ needs.check.outputs.sha }}" >> $GITHUB_ENV + echo "pool_bionic=${POOL_BIONIC}" >> $GITHUB_ENV + echo "pool_focal=${POOL_FOCAL}" >> $GITHUB_ENV + echo "pool_jammy=${POOL_JAMMY}" >> $GITHUB_ENV - name: Generate doxygen run: | git clone https://github.com/${REPOSLUG} cd ${REPO} - git checkout ${{ steps.setup.outputs.sha }} + git checkout ${{ env.sha }} git reset --hard rm -rf .git @@ -344,7 +341,7 @@ jobs: } echo "> Get file list" - RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.setup.outputs.id }}/assets?per_page=80) + RESULT=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" -X GET https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ env.id }}/assets?per_page=80) FILES=$(echo $RESULT | jq '.[].browser_download_url' -r) for item in $FILES do @@ -357,7 +354,7 @@ jobs: if [[ $item == *"bionic"* ]]; then echo "- 18.04: ${item}" - wget -nv ${item} -P ${{ steps.setup.outputs.pool_bionic }} + wget -nv ${item} -P ${{ env.pool_bionic }} if [[ $item == *"amd64"* ]]; then generate "bionic" "amd64" elif [[ $item == *"armhf"* ]]; then @@ -367,7 +364,7 @@ jobs: fi elif [[ $item == *"focal"* ]]; then echo "- 20.04: ${item}" - wget -nv ${item} -P ${{ steps.setup.outputs.pool_focal }} + wget -nv ${item} -P ${{ env.pool_focal }} if [[ $item == *"amd64"* ]]; then generate "focal" "amd64" elif [[ $item == *"armhf"* ]]; then @@ -377,7 +374,7 @@ jobs: fi elif [[ $item == *"jammy"* ]]; then echo "- 20.04: ${item}" - wget -nv ${item} -P ${{ steps.setup.outputs.pool_jammy }} + wget -nv ${item} -P ${{ env.pool_jammy }} if [[ $item == *"amd64"* ]]; then generate "jammy" "amd64" elif [[ $item == *"armhf"* ]]; then From 642178b2b7e4c43b4c89004234e8f483e6ff2d58 Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Tue, 29 Aug 2023 15:13:42 +0900 Subject: [PATCH 18/19] fix agl build script Signed-off-by: Inho Oh --- .github/workflows/release-agl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-agl.yaml b/.github/workflows/release-agl.yaml index f08a339d86..9dbed48cf1 100644 --- a/.github/workflows/release-agl.yaml +++ b/.github/workflows/release-agl.yaml @@ -116,7 +116,7 @@ jobs: #!/bin/bash set -e - source /opt/agl-sdk/11.0.4-*/environment-setup-* + source /opt/agl-sdk/11.0.*/environment-setup-* rm -rf build mkdir build From 41e202c5c3e3fbe205f5e66b9a8ee7fa06f3b4e4 Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Wed, 31 Jan 2024 16:29:41 +0900 Subject: [PATCH 19/19] build: upgrade action versions Signed-off-by: Inho Oh --- .github/workflows/release-docker.yaml | 10 +++++----- .github/workflows/release-ubuntu.yaml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-docker.yaml b/.github/workflows/release-docker.yaml index 85dc9a1003..b797c20983 100644 --- a/.github/workflows/release-docker.yaml +++ b/.github/workflows/release-docker.yaml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Generate docker image run: | echo "OS=$OSTYPE" @@ -75,19 +75,19 @@ jobs: echo "${{ env.build }}" - name: Set up QEMU if: ${{ env.build == 1}} - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx if: ${{ env.build == 1}} - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry if: ${{ env.build == 1}} - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push if: ${{ env.build == 1}} - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: docker/. platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml index baf15b5a35..2011acd5cd 100644 --- a/.github/workflows/release-ubuntu.yaml +++ b/.github/workflows/release-ubuntu.yaml @@ -220,7 +220,7 @@ jobs: BASEROOT: /tmp/www steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup id: setup run: |