Skip to content

Commit

Permalink
Update github-actions-demo.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lolo6oT authored Jan 18, 2024
1 parent dc4fcc3 commit fe5a4bb
Showing 1 changed file with 14 additions and 125 deletions.
139 changes: 14 additions & 125 deletions .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
@@ -1,129 +1,18 @@

name: Create Release on Tag
# on: [workflow_dispatch]
on:
push:
tags:
- "v*.*.*"

name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
build:
name: "${{ matrix.tag }} - ${{ matrix.build_env.pkgarch}} :: ${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}} build"
Explore-GitHub-Actions:
runs-on: ubuntu-latest
strategy:
matrix:
tag: ['v23.05.0', 'v23.05.2']
build_env:
- pkgarch: mipsel_24kc
target: ramips
subtarget: mt7620
- pkgarch: mipsel_24kc
target: ramips
subtarget: mt7621
- pkgarch: arm_cortex-a7
target: mediatek
subtarget: mt7629
steps:
- uses: actions/checkout@v4
with:
repository: openwrt/openwrt
ref: ${{ matrix.tag }}
fetch-depth: 0

- name: Cache Tools and Kernel
id: cache-tools-kernel
uses: actions/cache@v3
env:
cache-name: "cache-tools-kernel-${{ matrix.tag }}-${{ matrix.build_env.pkgarch}}-${{ matrix.build_env.target}}-${{ matrix.build_env.subtarget}}"
with:
path: .
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-cache-tools-kernel-${{ matrix.tag }}-${{ matrix.build_env.pkgarch}}-
${{ runner.os }}-build-cache-tools-kernel-${{ matrix.tag }}-
${{ runner.os }}-build-
- name: Building kernel and tools
if: ${{ steps.cache-tools-kernel.outputs.cache-hit != 'true' }}
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
pkgarch=${{ matrix.build_env.pkgarch}}
target=${{ matrix.build_env.target}}
subtarget=${{ matrix.build_env.subtarget}}
echo "pkgarch: ${pkgarch}, target: ${target}, subtarget: ${subtarget}"
echo "CONFIG_TARGET_${target}=y" > .config
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_DEFAULT_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_ALL_KMODS=y" >> .config
echo "CONFIG_PACKAGE_kmod-amneziawg=m" >> .config
echo "CONFIG_PACKAGE_amnezia-wg-tools=y" >> .config
echo "CONFIG_PACKAGE_luci-app-amneziawg=y" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20=m" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=m" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-chacha20poly1305=m" >> .config
make defconfig
echo " > make tools/install"
make tools/install -i -j `nproc`
echo " > make toolchain/install"
make toolchain/install -i -j `nproc`
# compile kernel module
echo " > make target/linux/compile"
make target/linux/compile -i -j `nproc` V=s
- name: Update feeds
run: |
# clean if cache restored from different cache key
rm -rf bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt/ || true
rm -rf bin/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/packages/ || true
cp feeds.conf.default feeds.conf
echo "src-git awgopenwrt https://github.com/yury-sannikov/awg-openwrt.git" >> ./feeds.conf
./scripts/feeds update luci
./scripts/feeds install -a -p luci
./scripts/feeds update awgopenwrt
./scripts/feeds install -a -p awgopenwrt
echo "CONFIG_PACKAGE_kmod-amneziawg=m" >> .config
echo "CONFIG_PACKAGE_amnezia-wg-tools=y" >> .config
echo "CONFIG_PACKAGE_luci-app-amneziawg=y" >> .config
make defconfig
- name: Build amnezia-wg-tools
run: |
make package/amnezia-wg-tools/{clean,download,prepare}
make package/amnezia-wg-tools/compile
- name: Build kmod-amneziawg
run: |
make package/kmod-amneziawg/{clean,download,prepare}
make package/kmod-amneziawg/compile
- name: Build luci
run: |
make package/luci-app-amneziawg/{clean,download,prepare}
make package/luci-app-amneziawg/compile V=s
- name: Prepare artifacts
run: |
tag_name=${{ github.ref_name }}
mkdir -p awgrelease
postfix="${tag_name}_${{ matrix.tag }}_${{ matrix.build_env.pkgarch}}_${{ matrix.build_env.target}}_${{ matrix.build_env.subtarget}}"
cp bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt/amnezia-wg-tools_*.ipk awgrelease/amnezia-wg-tools_${postfix}.ipk
cp bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt/luci-app-amneziawg_*.ipk awgrelease/luci-app-amneziawg_${postfix}.ipk
cp bin/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/packages/kmod-amneziawg_*.ipk awgrelease/kmod-amneziawg_${postfix}.ipk
- name: Release
uses: softprops/action-gh-release@v1
with:
files: awgrelease/*.ipk

- name: Cleanup
run: |
rm feeds.conf || true
rm -rf awgrelease || true
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."

0 comments on commit fe5a4bb

Please sign in to comment.