Skip to content

Commit

Permalink
update with version
Browse files Browse the repository at this point in the history
  • Loading branch information
wjz304 committed Mar 12, 2024
1 parent 65071b4 commit 98099b2
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/addons-eudev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
echo "Copy eudev ..."
rm -rf qr-addons/eudev/all/addons/eudev*.tgz
mkdir -p qr-addons/eudev/all/addons/
mv -vf eudev/*.tgz qr-addons/eudev/all/addons/
mv -f eudev/*.tgz qr-addons/eudev/all/addons/
cd qr-addons
echo "Git push ..."
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/addons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,29 @@ jobs:
run: |
cd qr-addons
. ./compile.sh
echo "${{ env.VERSION }}" > "VERSION"
zip -9 ${{ github.workspace }}/addons.zip -j *.addon VERSION
VERSION="${{ env.VERSION }}"
VERSION="${VERSION:-"test"}"
echo "${VERSION}" > "VERSION"
zip -9 ${{ github.workspace }}/addons-${VERSION}.zip -j *.addon VERSION
- name: Upload to Artifacts
if: env.VERSION == ''
uses: actions/upload-artifact@v3
with:
name: addons
path: |
addons.zip
addons*.zip
retention-days: 5

- name: Release
uses: ncipollo/release-action@v1
if: env.VERSION != ''
with:
tag: ${{ env.VERSION }}
prerelease: ${{ inputs.prerelease }}
artifacts: addons.zip
artifacts: addons*.zip
owner: RROrg
repo: qr-addons
token: ${{ secrets.RRORG }}
20 changes: 14 additions & 6 deletions .github/workflows/buildroot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,33 @@ jobs:
[ -n "${BUILDROOT_VERSION}" ] && echo "BUILDROOT_VERSION=${BUILDROOT_VERSION}" >> $GITHUB_ENV || exit 1
[ -n "${KERNEL_VERSION}" ] && echo "KERNEL_VERSION=${KERNEL_VERSION}" >> $GITHUB_ENV || exit 1
- name: Zip modules
run: |
cp -f buildroot/.qr-buildroot/output/images/bzImage bzImage-qr || exit 1
cp -f buildroot/.qr-buildroot/output/images/rootfs.cpio.xz initrd-qr || exit 1
VERSION="${{ env.VERSION }}"
VERSION="${VERSION:-"test"}"
echo "${VERSION}" > "VERSION"
zip -9 ${{ github.workspace }}/buildroot-${VERSION}.zip -j bzImage-qr initrd-qr VERSION
- name: Upload artifact
if: env.VERSION == ''
uses: actions/upload-artifact@v3
with:
name: buildroot
path: |
buildroot/.qr-buildroot/output/images/bzImage
buildroot/.qr-buildroot/output/images/rootfs.cpio.xz
buildroot*.zip
retention-days: 5

# Publish a release if is a tag
- name: Release
if: env.VERSION != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
prerelease: ${{ inputs.prerelease }}
artifacts: |
buildroot/.qr-buildroot/output/images/bzImage
buildroot/.qr-buildroot/output/images/rootfs.cpio.xz
artifacts: buildroot*.zip
body: |
Buildroot version: ${{ env.BUILDROOT_VERSION }}
Kernel version: ${{ env.KERNEL_VERSION }}
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/grub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ on:
description: "push"
default: false
type: boolean
grubver:
description: "grub version"
default: "grub-2.12"
type: string
bioslst:
description: "bios list"
default: "i386-pc i386-efi x86_64-efi"
type: string
namestr:
description: "name string"
default: "QR"
type: string

jobs:
grub:
runs-on: ubuntu-latest
Expand All @@ -35,11 +48,11 @@ jobs:
sudo timedatectl set-timezone "Asia/Shanghai"
sudo apt update
sudo apt install -y build-essential bison flex dosfstools
sudo apt install -y autoconf automake autopoint gettext build-essential bison flex libtool dosfstools e2fsprogs
- name: Make Grub
run: |
. qr/scripts/grub.sh "grub-2.06" "i386-pc i386-efi x86_64-efi" "QR"
. qr/scripts/grub.sh "${{ inputs.grubver}}" "${{ inputs.bioslst}}" "${{ inputs.namestr}}"
- name: Upload artifact
if: success() && inputs.push == false
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,31 +119,40 @@ jobs:
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: download to artifacts
if: env.VERSION != ''
uses: actions/download-artifact@v3
with:
name: modules
path: ./modules

- name: delete-artifact
if: env.VERSION != ''
uses: geekyeggo/delete-artifact@v2
with:
name: modules

- name: Zip modules
if: env.VERSION != ''
run: |
echo "${{ env.VERSION }}" > "modules/VERSION"
zip -9 modules.zip -j modules/*
VERSION="${{ env.VERSION }}"
VERSION="${VERSION:-"test"}"
echo "${VERSION}" > "modules/VERSION"
zip -9 modules-${VERSION}.zip -j modules/*
- name: Upload to Artifacts
if: env.VERSION == ''
uses: actions/upload-artifact@v3
with:
name: modules
path: |
modules*.zip
retention-days: 5

- name: Release
if: env.VERSION != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
prerelease: ${{ inputs.prerelease }}
artifacts: modules.zip
artifacts: modules*.zip
owner: RROrg
repo: qr-modules
token: ${{ secrets.RRORG }}
55 changes: 24 additions & 31 deletions .github/workflows/qr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ on:
description: "pre release"
default: false
type: boolean
br2tag:
description: "buildroot tag"
default: ""
type: string

jobs:
build:
Expand Down Expand Up @@ -89,25 +85,27 @@ jobs:
fi
fi
# Convert po2mo
- name: Convert po2mo
# Convert po2mo, addons and Modules
- name: Convert po2mo, addons and Modules
run: |
cd qr
. scripts/func.sh "${{ secrets.RRORG }}"
convertpo2mo "files/initrd/opt/qr/lang"
getAddons "files/p8/addons" ${{ inputs.prerelease }}
getModules "files/p8/modules" ${{ inputs.prerelease }}
getBuildroot "files/p8" ${{ inputs.prerelease }}
echo "OK"
# Build incremental
- name: Build image
run: |
cd qr
. scripts/func.sh "${{ secrets.RRORG }}"
echo "Create RR image"
gzip -dc "files/grub.img.gz" >"qr.img"
fdisk -l "qr.img"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "qr.img"
Expand All @@ -117,15 +115,8 @@ jobs:
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p8 "/tmp/p8"
echo "Get Buildroot"
BR2TAG="${{ inputs.br2tag }}"
[ -z "${BR2TAG}" ] && BR2TAG="latest"
getBuildroot "br" "${BR2TAG}"
[ ! -f "br/bzImage-qr" -o ! -f "br/initrd-qr" ] && return 1
echo "Repack initrd"
cp -f "br/bzImage-qr" "files/p8/bzImage-qr"
repackInitrd "br/initrd-qr" "files/initrd" "files/p8/initrd-qr"
repackInitrd "files/p8/initrd-qr" "files/initrd"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
Expand All @@ -148,53 +139,53 @@ jobs:
- name: Pack
run: |
cd qr
if [ -n "${{ env.VERSION }}" ]; then
zip -9 "qr-${{ env.VERSION }}.img.zip" qr.img
# zip -9 "qr-${{ env.VERSION }}.vmdk-dyn.zip" qr-dyn.vmdk
# zip -9 "qr-${{ env.VERSION }}.vmdk-flat.zip" qr.vmdk qr-flat.vmdk
else
zip -9 "qr.img.zip" qr.img
fi
VERSION="${{ env.VERSION }}"
VERSION="${VERSION:-"test"}"
zip -9 "qr-${VERSION}.img.zip" qr.img
# zip -9 "qr-${VERSION}.vmdk-dyn.zip" qr-dyn.vmdk
# zip -9 "qr-${VERSION}.vmdk-flat.zip" qr.vmdk qr-flat.vmdk
# update.zip
sha256sum update-list.yml update-check.sh > sha256sum
zip -9j update.zip update-list.yml update-check.sh
zip -9j "update-${VERSION}.zip" update-list.yml update-check.sh
while read F; do
if [ -d "${F}" ]; then
FTGZ="$(basename "${F}").tgz"
tar -czf "${FTGZ}" -C "${F}" .
sha256sum "${FTGZ}" >> sha256sum
zip -9j update.zip "${FTGZ}"
zip -9j "update-${VERSION}.zip" "${FTGZ}"
rm -f "${FTGZ}"
else
(cd $(dirname "${F}") && sha256sum $(basename "${F}")) >> sha256sum
zip -9j update.zip "${F}"
zip -9j "update-${VERSION}.zip" "${F}"
fi
done < <(yq '.replace | explode(.) | to_entries | map([.key])[] | .[]' update-list.yml)
zip -9j update.zip sha256sum
zip -9j "update-${VERSION}.zip" sha256sum
# updateall.zip
rm -f sha256sum
echo ' "files/p8/addons/": "/mnt/p8/addons/"' >> update-list.yml
echo ' "files/p8/modules/": "/mnt/p8/modules/"' >> update-list.yml
zip -9j updateall.zip update-list.yml update-check.sh
zip -9j "updateall-${VERSION}.zip" update-list.yml update-check.sh
while read F; do
if [ -d "${F}" ]; then
FTGZ="$(basename "${F}").tgz"
tar -czf "${FTGZ}" -C "${F}" .
sha256sum "${FTGZ}" >> sha256sum
zip -9j updateall.zip "${FTGZ}"
zip -9j "updateall-${VERSION}.zip" "${FTGZ}"
rm -f "${FTGZ}"
else
(cd $(dirname "${F}") && sha256sum $(basename "${F}")) >> sha256sum
zip -9j updateall.zip "${F}"
zip -9j "updateall-${VERSION}.zip" "${F}"
fi
done < <(yq '.replace | explode(.) | to_entries | map([.key])[] | .[]' update-list.yml)
zip -9j updateall.zip sha256sum
zip -9j "updateall-${VERSION}.zip" sha256sum
# Upload artifact
- name: Upload
- name: Upload to Artifacts
if: env.VERSION == ''
uses: actions/upload-artifact@v3
with:
Expand All @@ -214,6 +205,8 @@ jobs:
artifacts: |
qr/qr*.zip
qr/update*.zip
body: |
- [Changelog](https://t.me/QR_Changelog)
owner: RROrg
repo: qr
token: ${{ secrets.RRORG }}

0 comments on commit 98099b2

Please sign in to comment.