66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
name: Build on push
|
|
run-name: Build on push
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
|
|
jobs:
|
|
prepare:
|
|
runs-on: [runner]
|
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
|
steps:
|
|
- uses: https://git.sh-edraft.de/sh-edraft.de/actions/set-version@dev
|
|
with:
|
|
version_suffix: dev
|
|
env:
|
|
CI_ACCESS_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
|
|
build:
|
|
runs-on: [runner]
|
|
needs: prepare
|
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
|
steps:
|
|
- name: Clone Repository
|
|
uses: https://github.com/actions/checkout@v3
|
|
with:
|
|
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
|
|
- name: Download build version artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: version
|
|
|
|
- name: Build single file executables
|
|
run: |
|
|
cd sh.actions/sh.actions.package-cleanup
|
|
|
|
# Build for Linux x64
|
|
dotnet publish -c Release -r linux-x64 -p:Version=$(cat ../../version.txt) -o publish/linux-x64
|
|
|
|
- name: Upload to Gitea Generic Package Registry
|
|
run: |
|
|
cd sh.actions/sh.actions.package-cleanup
|
|
curl -X PUT \
|
|
-H "Authorization: token ${{ secrets.CI_ACCESS_TOKEN }}" \
|
|
-T publish/linux-x64/sh.actions.package-cleanup \
|
|
"https://git.sh-edraft.de/api/packages/sh-edraft.de/generic/package-cleanup/$(cat ../../version.txt)/package-cleanup-linux-x64"
|
|
|
|
test:
|
|
runs-on: [runner]
|
|
needs: build
|
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
|
steps:
|
|
- name: Download and test package-cleanup tool
|
|
shell: bash
|
|
run: |
|
|
curl -OJ https://git.sh-edraft.de/api/packages/sh-edraft.de/generic/package-cleanup/package-cleanup-linux-x64
|
|
|
|
# Make executable
|
|
chmod +x package-cleanup-linux-x64
|
|
|
|
- name: Run package-cleanup
|
|
shell: bash
|
|
run: |
|
|
./package-cleanup-linux-x64
|