2025-02-13 19:35:27 +03:00
|
|
|
name: Build and Package OPKG
|
|
|
|
|
|
|
|
on:
|
2025-02-15 06:25:34 +03:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
|
|
|
- main
|
2025-02-15 06:34:53 +03:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- '.github/**'
|
|
|
|
- '!.github/workflows/build-for-release.yml'
|
2025-02-15 00:58:29 +03:00
|
|
|
release:
|
|
|
|
types: [published]
|
2025-02-13 19:35:27 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2025-02-15 06:25:34 +03:00
|
|
|
name: Build for "${{ matrix.target }}"
|
2025-02-13 19:35:27 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
2025-02-15 06:25:34 +03:00
|
|
|
- target: mipsel-3.4
|
2025-02-13 19:35:27 +03:00
|
|
|
goos: linux
|
|
|
|
goarch: mipsle
|
|
|
|
gomips: softfloat
|
2025-02-15 06:25:34 +03:00
|
|
|
- target: mips-3.4
|
2025-02-13 19:35:27 +03:00
|
|
|
goos: linux
|
|
|
|
goarch: mips
|
|
|
|
gomips: softfloat
|
2025-02-15 06:25:34 +03:00
|
|
|
- target: aarch64-3.10
|
2025-02-13 19:35:27 +03:00
|
|
|
goos: linux
|
|
|
|
goarch: arm64
|
2025-02-15 06:25:34 +03:00
|
|
|
- target: armv7-3.2
|
2025-02-13 19:35:27 +03:00
|
|
|
goos: linux
|
|
|
|
goarch: arm
|
|
|
|
goarm: 7
|
2025-02-15 06:25:34 +03:00
|
|
|
- target: armv7-2.6
|
2025-02-14 00:34:41 +03:00
|
|
|
goos: linux
|
|
|
|
goarch: arm
|
|
|
|
goarm: 7
|
2025-02-15 06:25:34 +03:00
|
|
|
- target: armv5-3.2
|
2025-02-13 19:35:27 +03:00
|
|
|
goos: linux
|
|
|
|
goarch: arm
|
|
|
|
goarm: 5
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
2025-02-14 00:51:31 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
fetch-tags: true
|
2025-02-13 19:35:27 +03:00
|
|
|
|
|
|
|
- name: Set up Go
|
2025-02-15 00:47:22 +03:00
|
|
|
uses: actions/setup-go@v3
|
2025-02-13 19:35:27 +03:00
|
|
|
with:
|
|
|
|
go-version: '1.21'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y fakeroot
|
|
|
|
|
2025-02-13 21:08:11 +03:00
|
|
|
- name: Build and Package
|
2025-02-13 19:35:27 +03:00
|
|
|
run: |
|
2025-02-15 06:25:34 +03:00
|
|
|
TARGET=${{ matrix.target }} GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} GOMIPS=${{ matrix.gomips }} GOARM=${{ matrix.goarm }} make
|
|
|
|
|
|
|
|
- name: Fetching file list for artifact
|
|
|
|
if: ${{ github.event_name != 'release' }}
|
|
|
|
id: create_file_list
|
|
|
|
run: |
|
|
|
|
echo 'file_list<<EOF' >> $GITHUB_OUTPUT
|
|
|
|
find . -name "magitrickle_*_${{ matrix.target }}.ipk" -print >> $GITHUB_OUTPUT
|
|
|
|
echo 'EOF' >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
if: ${{ github.event_name != 'release' }}
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.target }}
|
|
|
|
path: ${{ steps.create_file_list.outputs.file_list }}
|
|
|
|
if-no-files-found: error
|
2025-02-13 19:35:27 +03:00
|
|
|
|
2025-02-15 00:58:29 +03:00
|
|
|
- name: Upload asset to release
|
2025-02-15 06:25:34 +03:00
|
|
|
if: ${{ github.event_name == 'release' }}
|
2025-02-15 00:58:29 +03:00
|
|
|
uses: https://gitea.com/actions/release-action@main
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
files: |-
|
2025-02-15 06:25:34 +03:00
|
|
|
./.build/magitrickle_*_${{ matrix.target }}.ipk
|
2025-02-15 00:58:29 +03:00
|
|
|
api_key: '${{secrets.RELEASE_TOKEN}}'
|