Some checks failed
/ release (push) Failing after 5m52s
/ build (arm64) (push) Successful in 9m10s
/ build (mips64) (push) Successful in 9m5s
/ build (ppc64le) (push) Successful in 5m6s
/ build (mips64le) (push) Successful in 9m1s
/ build (arm) (push) Successful in 8m13s
/ build (loong64) (push) Successful in 9m7s
/ build (386) (push) Successful in 8m22s
/ build (mips) (push) Successful in 9m4s
/ build (ppc64) (push) Successful in 4m49s
/ build (amd64) (push) Successful in 9m15s
/ build (mipsle) (push) Successful in 4m39s
/ build (s390x) (push) Successful in 5m5s
/ build (riscv64) (push) Successful in 5m11s
145 lines
4.4 KiB
YAML
145 lines
4.4 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
schedule:
|
|
- cron: "0 0 */3 * *"
|
|
# workflow_dispatch:
|
|
# inputs:
|
|
# PKG_VERSION:
|
|
# type: string
|
|
# required: false
|
|
# default: main
|
|
# description: Version of gitea act-runner
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
PKG_VERSION: "${{ github.event.inputs.PKG_VERSION || 'main' }}"
|
|
strategy:
|
|
matrix:
|
|
ARCH:
|
|
- "386"
|
|
- "amd64"
|
|
- "arm"
|
|
- "arm64"
|
|
- "riscv64"
|
|
- "loong64"
|
|
- "mips"
|
|
- "mips64"
|
|
- "mips64le"
|
|
- "mipsle"
|
|
- "ppc64"
|
|
- "ppc64le"
|
|
- "s390x"
|
|
steps:
|
|
- name: Install dpkg pkgs depencies
|
|
env:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y dpkg-dev
|
|
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: "^1.21"
|
|
cache: true
|
|
|
|
- name: Clone act_runner
|
|
run: |
|
|
git clone https://gitea.com/gitea/act_runner.git act_runner
|
|
cd act_runner
|
|
if [[ "${PKG_VERSION}" == "main" ]]; then
|
|
PKG_VERSION="$(git describe | sed 's/^v//')"
|
|
echo "PKG_VERSION=${PKG_VERSION}" > $GITHUB_ENV
|
|
elif [[ -z "${PKG_VERSION}" ]]; then
|
|
PKG_VERSION="$(git describe | sed 's/^v//')"
|
|
echo "PKG_VERSION=${PKG_VERSION}" > $GITHUB_ENV
|
|
git checkout "${PKG_VERSION}"
|
|
else
|
|
git checkout "${PKG_VERSION}" || echo "Version not found, using main" && git switch main
|
|
fi
|
|
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
path: ${{ github.workspace }}/pkg
|
|
|
|
- name: Create control file
|
|
working-directory: ${{ github.workspace }}/pkg
|
|
run: |
|
|
set -x
|
|
# Clean
|
|
rm -rfv .github .git .vscode *.md
|
|
find . -type f -name '.gitkeep' | xargs rm -fv
|
|
|
|
# Rename arch
|
|
function editArch() {
|
|
echo "AARCH=${1}" >> $GITHUB_ENV
|
|
(
|
|
echo "Package: gitea-act-runner";
|
|
echo "Maintainer: Matheus Sampaio Queiroga <me@sirherobrine23.org>";
|
|
echo "Version: ${PKG_VERSION}";
|
|
echo "Architecture: ${1}";
|
|
echo "Depends: docker-ce | docker.io";
|
|
echo "Homepage: https://gitea.com/gitea/act_runner";
|
|
echo "Priority: optional";
|
|
echo "Section: default";
|
|
echo "Description: Host your own runner for gitea, gitea runner comes with several advantages compared to github runner.";
|
|
echo;
|
|
) > DEBIAN/control
|
|
echo;
|
|
cat DEBIAN/control
|
|
}
|
|
|
|
if [[ "${{ matrix.ARCH }}" == "386" ]]; then
|
|
editArch "i386"
|
|
elif [[ "${{ matrix.ARCH }}" == "arm" ]]; then
|
|
editArch "armeb"
|
|
else
|
|
editArch "${{ matrix.ARCH }}"
|
|
fi
|
|
|
|
- name: build
|
|
working-directory: ${{ github.workspace }}/act_runner
|
|
run: |
|
|
set -x
|
|
RELASE_VERSION="${PKG_VERSION}" GOOS="linux" GOARCH="${{ matrix.ARCH }}" TAGS="netgo osusergo" make build
|
|
cp -v act_runner "${{ github.workspace }}/pkg/usr/bin"
|
|
cp -v act_runner "${{ github.workspace }}/act_runner_${{ matrix.ARCH }}"
|
|
|
|
- name: Build pkg
|
|
working-directory: ${{ github.workspace }}/pkg
|
|
run: |
|
|
set -x
|
|
dpkg-deb --verbose -Z gzip --build . ../act-runner-${AARCH}_${PKG_VERSION}.deb
|
|
|
|
- name: Upload to artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: act-runner_${{ matrix.ARCH }}
|
|
path: |
|
|
./act_runner_*
|
|
./*act-runner*.deb
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: [ build ]
|
|
steps:
|
|
- name: Install packages
|
|
env:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y curl
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
- name: Upload files
|
|
run: |
|
|
find . -name '*.deb' -exec mv -v {} "${{ github.workspace }}" \;
|
|
for FILE in *.deb; do
|
|
echo "Uploading: ${FILE}"
|
|
curl -X 'PUT' --user "${{ github.actor }}:${{ secrets.PKG_TOKEN }}" --upload-file "${FILE}" "https://sirherobrine23.com.br/api/packages/${{ github.repository_owner }}/debian/pool/gitea/main/upload"
|
|
done
|