Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hzyitc committed Jun 20, 2023
1 parent 096145b commit 83a9e53
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 146 deletions.
290 changes: 145 additions & 145 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,71 +3,71 @@ on:
push:

jobs:
build:
name: Build / ${{ matrix.branch }} / ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch:
- openwrt-19.07
- openwrt-21.02
- openwrt-22.03
- openwrt-23.05
- master
# - snapshot
arch:
# - aarch64_cortex-a53
# - aarch64_cortex-a72
- aarch64_generic
# # - arc_arc700
# # - arc_archs
# - arm_arm1176jzf-s_vfp
# - arm_arm926ej-s
# - arm_cortex-a15_neon-vfpv4
# - arm_cortex-a5_vfpv4
# - arm_cortex-a7
# - arm_cortex-a7_neon-vfpv4
# - arm_cortex-a8_vfpv3
# - arm_cortex-a9
# - arm_cortex-a9_neon
# - arm_cortex-a9_vfpv3-d16
# - arm_fa526
# - arm_mpcore
# - arm_xscale
# - i386_pentium-mmx
# - i386_pentium4
# - mips64_octeonplus
# - mips_24kc
# - mips_4kec
# - mips_mips32
# - mipsel_24kc
# - mipsel_24kc_24kf
# - mipsel_74kc
# - mipsel_mips32
# - powerpc_464fp
# - powerpc_8540
- x86_64
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build
uses: openwrt/gh-action-sdk@v5
env:
ARCH: ${{ matrix.arch }}-${{ matrix.branch }}
KEY_BUILD: ${{ secrets.KEY_BUILD }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.branch }}-${{ matrix.arch }}
path: bin/packages/${{ matrix.arch }}/action/*
# build:
# name: Build / ${{ matrix.branch }} / ${{ matrix.arch }}
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# branch:
# - openwrt-19.07
# - openwrt-21.02
# - openwrt-22.03
# - openwrt-23.05
# - master
# # - snapshot
# arch:
# # - aarch64_cortex-a53
# # - aarch64_cortex-a72
# - aarch64_generic
# # # - arc_arc700
# # # - arc_archs
# # - arm_arm1176jzf-s_vfp
# # - arm_arm926ej-s
# # - arm_cortex-a15_neon-vfpv4
# # - arm_cortex-a5_vfpv4
# # - arm_cortex-a7
# # - arm_cortex-a7_neon-vfpv4
# # - arm_cortex-a8_vfpv3
# # - arm_cortex-a9
# # - arm_cortex-a9_neon
# # - arm_cortex-a9_vfpv3-d16
# # - arm_fa526
# # - arm_mpcore
# # - arm_xscale
# # - i386_pentium-mmx
# # - i386_pentium4
# # - mips64_octeonplus
# # - mips_24kc
# # - mips_4kec
# # - mips_mips32
# # - mipsel_24kc
# # - mipsel_24kc_24kf
# # - mipsel_74kc
# # - mipsel_mips32
# # - powerpc_464fp
# # - powerpc_8540
# - x86_64
# steps:
# - name: Checkout
# uses: actions/checkout@v3

# - name: Build
# uses: openwrt/gh-action-sdk@v5
# env:
# ARCH: ${{ matrix.arch }}-${{ matrix.branch }}
# KEY_BUILD: ${{ secrets.KEY_BUILD }}

# - name: Upload artifacts
# uses: actions/upload-artifact@v3
# with:
# name: ${{ matrix.branch }}-${{ matrix.arch }}
# path: bin/packages/${{ matrix.arch }}/action/*

test:
name: Test / ${{ matrix.branch }} / ${{ matrix.arch }}
if: ${{ !cancelled() }}
needs: [ build ]
# needs: [ build ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -99,10 +99,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ matrix.branch }}-${{ matrix.arch }}
# - name: Download artifacts
# uses: actions/download-artifact@v3
# with:
# name: ${{ matrix.branch }}-${{ matrix.arch }}

- name: Setup QEMU binfmt
run: |
Expand All @@ -118,83 +118,83 @@ jobs:
env:
TAG: ${{ matrix.arch }}-${{ matrix.branch }}

release:
if: ${{ !cancelled() }}
needs: [ test ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts/

- name: Release
run: |
time="${{ github.event.head_commit.timestamp }}"
sha="${GITHUB_SHA:0:8}"
tag="ci-$(date +'%Y%m%d-%H%M' -d "$time")"
message="Auto-Release $(date +'%Y-%m-%d %H:%M' -d "$time")"
hub release create $(for a in artifacts/*/*.ipk; do echo -a $a; done) -t "$GITHUB_SHA" "$tag" -m "$message"
env:
GITHUB_TOKEN: ${{ github.token }}

gh-pages:
if: ${{ !cancelled() }}
needs: [ test ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout pages
uses: actions/checkout@v3
with:
path: 'gh-pages'
ref: 'gh-pages'
fetch-depth: 0

- name: Configure the git user
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Drop old versions
run: |
cd gh-pages
readarray -t old_version < <(git log --format='%h' -- "*/*/Packages" | tail -n +1)
GIT_SEQUENCE_EDITOR="sed -i '1 i break'" git rebase -i --root
for commit in "${old_version[@]}"; do
sed -i "/${commit}/d" .git/rebase-merge/git-rebase-todo
done
git rebase --continue
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts/

- name: Reorganize structure
run: |
for path in artifacts/*; do
name="${path##*/}"
version=$(echo "${name}" | cut -d'-' -f1)
arch=$(echo "${name}" | cut -d'-' -f2-)
mkdir -p "gh-pages/${version}/${arch}/"
mv -v "${path}/"* "gh-pages/${version}/${arch}/"
done
- name: Commit
run: |
cd gh-pages
git add .
git commit -m "Add packages"
- name: Publish
run: |
cd gh-pages
git push -f origin gh-pages
# release:
# if: ${{ !cancelled() }}
# needs: [ test ]
# runs-on: ubuntu-latest
# permissions:
# contents: write
# steps:
# - name: Checkout
# uses: actions/checkout@v3

# - name: Download artifacts
# uses: actions/download-artifact@v3
# with:
# path: artifacts/

# - name: Release
# run: |
# time="${{ github.event.head_commit.timestamp }}"
# sha="${GITHUB_SHA:0:8}"
# tag="ci-$(date +'%Y%m%d-%H%M' -d "$time")"
# message="Auto-Release $(date +'%Y-%m-%d %H:%M' -d "$time")"
# hub release create $(for a in artifacts/*/*.ipk; do echo -a $a; done) -t "$GITHUB_SHA" "$tag" -m "$message"
# env:
# GITHUB_TOKEN: ${{ github.token }}

# gh-pages:
# if: ${{ !cancelled() }}
# needs: [ test ]
# runs-on: ubuntu-latest
# permissions:
# contents: write
# steps:
# - name: Checkout pages
# uses: actions/checkout@v3
# with:
# path: 'gh-pages'
# ref: 'gh-pages'
# fetch-depth: 0

# - name: Configure the git user
# run: |
# git config --global user.name 'github-actions[bot]'
# git config --global user.email 'github-actions[bot]@users.noreply.github.com'

# - name: Drop old versions
# run: |
# cd gh-pages
# readarray -t old_version < <(git log --format='%h' -- "*/*/Packages" | tail -n +1)
# GIT_SEQUENCE_EDITOR="sed -i '1 i break'" git rebase -i --root
# for commit in "${old_version[@]}"; do
# sed -i "/${commit}/d" .git/rebase-merge/git-rebase-todo
# done
# git rebase --continue

# - name: Download artifacts
# uses: actions/download-artifact@v3
# with:
# path: artifacts/

# - name: Reorganize structure
# run: |
# for path in artifacts/*; do
# name="${path##*/}"
# version=$(echo "${name}" | cut -d'-' -f1)
# arch=$(echo "${name}" | cut -d'-' -f2-)

# mkdir -p "gh-pages/${version}/${arch}/"
# mv -v "${path}/"* "gh-pages/${version}/${arch}/"
# done

# - name: Commit
# run: |
# cd gh-pages
# git add .
# git commit -m "Add packages"

# - name: Publish
# run: |
# cd gh-pages
# git push -f origin gh-pages
3 changes: 2 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ opkg-key add /ci/emulator-openwrt.key.pub
# Install feed
. /etc/os-release
MAJOR_VERSION="$(echo "${VERSION_ID}" | grep -oE '[0-9]+\.[0-9]+' || echo "snapshot")"
echo "src/gz emulator file:///ci/${MAJOR_VERSION}-${OPENWRT_ARCH}/" >>/etc/opkg/customfeeds.conf
# echo "src/gz emulator file:///ci/${MAJOR_VERSION}-${OPENWRT_ARCH}/" >>/etc/opkg/customfeeds.conf
echo "src/gz emulator https://hzyitc.github.io/emulator-openwrt/openwrt/${MAJOR_VERSION}-${OPENWRT_ARCH}" >>/etc/opkg/customfeeds.conf

echo "::group::Install python3-androidnativeemu"
opkg update
Expand Down

0 comments on commit 83a9e53

Please sign in to comment.