Skip to content

Commit

Permalink
build: update action version
Browse files Browse the repository at this point in the history
Node.js v12 is deprecated in Github action. So need to update related
Github actions.

Signed-off-by: Inho Oh <webispy@gmail.com>
webispy committed Oct 18, 2022
1 parent d70a64b commit ec5ebc8
Showing 6 changed files with 95 additions and 105 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/generate-release.yaml
Original file line number Diff line number Diff line change
@@ -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<<EOF" >> $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@-
26 changes: 12 additions & 14 deletions .github/workflows/release-agl.yaml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 10 additions & 12 deletions .github/workflows/release-allwinner.yaml
Original file line number Diff line number Diff line change
@@ -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/*
25 changes: 12 additions & 13 deletions .github/workflows/release-docker.yaml
Original file line number Diff line number Diff line change
@@ -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,34 +64,34 @@ 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/.
platforms: linux/amd64,linux/arm64
push: true
tags: nugulinux/sdk:unstable
build-args: |
LAST_COMMIT=${{ steps.check.outputs.sha }}
LAST_COMMIT=${{ env.sha }}
26 changes: 12 additions & 14 deletions .github/workflows/release-tizen.yaml
Original file line number Diff line number Diff line change
@@ -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/*
71 changes: 34 additions & 37 deletions .github/workflows/release-ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -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,35 +77,34 @@ 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
do
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:
<h1>DEB Package repository for unstable release</h1>
<p>
last unstable commit: <a href="https://github.com/nugu-developers/nugu-linux/commit/${{ steps.setup.outputs.sha }}">${{ steps.setup.outputs.sha }}</a>
last unstable commit: <a href="https://github.com/nugu-developers/nugu-linux/commit/${{ env.sha }}">${{ env.sha }}</a>
</p>
<p>
@@ -308,17 +305,17 @@ jobs:
</html>
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

0 comments on commit ec5ebc8

Please sign in to comment.