| 1 | name: daily musl |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | inputs: |
| 6 | release_note: |
| 7 | description: 'build and release vendetta for linux musl' |
| 8 | required: false |
| 9 | default: ':3' |
| 10 | type: string |
| 11 | |
| 12 | jobs: |
| 13 | build-and-release: |
| 14 | runs-on: alpine-edge |
| 15 | env: |
| 16 | FFMPEG_REF: n7.0 |
| 17 | LIBASS_REF: 0.17.5 |
| 18 | MPV_REF: e471496c56 |
| 19 | JOBS: 4 |
| 20 | |
| 21 | steps: |
| 22 | - name: Install deps |
| 23 | run: | |
| 24 | apk update |
| 25 | apk --no-cache add 7zip bash binutils diffutils elfutils file freeglut-dev freetype-dev gc gc-dev gcc gcompat gdb git glew-dev glfw-dev glu-dev icu-data-full libc-dev libc6-compat libev-dev libevent-dev libmemcached-dev libunwind-dev libunwind-static libuv-dev libx11-dev libxcursor-dev libxi-dev libxi-static make mbedtls mesa-dev mesa-gl mesa-gles micro mpv-dev musl-dev nano nano-syntax nodejs openssl-dev pcre rsync sdl2-dev sdl2_gfx-dev sdl2_image-dev sdl2_net-dev sdl2_pango-dev sdl2_ttf-dev sqlite-dev strace tmux upx wasi-sdk jq |
| 26 | |
| 27 | git clone --depth=1 https://github.com/vlang/v /tmp/v |
| 28 | make -C /tmp/v |
| 29 | /tmp/v/v version |
| 30 | /tmp/v/v install ui2 |
| 31 | |
| 32 | - name: Checkout code |
| 33 | uses: https://data.forgejo.org/actions/checkout@v7 |
| 34 | with: |
| 35 | fetch-depth: 0 |
| 36 | |
| 37 | - name: Build, Package and Release |
| 38 | env: |
| 39 | TOKEN: ${{ forgejo.token }} |
| 40 | API: "https://git.vorelabs.dev/api/v1/repos/vorelabs/vendetta" |
| 41 | NOTE: ${{ inputs.release_note }} |
| 42 | run: | |
| 43 | DATE=$(date +'%d%m%Y') |
| 44 | DATEP=$(date +'%d.%m.%Y') |
| 45 | TAG="$DATE" |
| 46 | FILE=/tmp/vendetta-$TAG-linux-musl.zip |
| 47 | |
| 48 | mkdir /tmp/dist |
| 49 | |
| 50 | /tmp/v/v -new-compiler -prod -d ui2_custom_rendering src -o /tmp/dist/vendetta |
| 51 | cp -R assets/ /tmp/dist/ |
| 52 | |
| 53 | cd /tmp/dist |
| 54 | sha256sum vendetta > SHA256SUMS |
| 55 | |
| 56 | 7z a $FILE /tmp/dist/* |
| 57 | |
| 58 | RELEASE_BODY=$(jq -n \ |
| 59 | --arg tag "$TAG" \ |
| 60 | --arg name "Vendetta $DATEP" \ |
| 61 | --arg body "o_O" \ |
| 62 | --arg target "$GITHUB_SHA" \ |
| 63 | '{tag_name: $tag, name: $name, body: $body, target_commitish: $target}') |
| 64 | |
| 65 | RELEASE_JSON=$(curl -fsS -H "Authorization: token $TOKEN" \ |
| 66 | "$API/releases/tags/$TAG" 2>/dev/null || true) |
| 67 | if [ -z "$RELEASE_JSON" ]; then |
| 68 | RELEASE_JSON=$(curl -fsS -X POST "$API/releases" \ |
| 69 | -H "Authorization: token $TOKEN" \ |
| 70 | -H "Content-Type: application/json" \ |
| 71 | -d "$RELEASE_BODY") |
| 72 | fi |
| 73 | |
| 74 | RELEASE_ID=$(printf '%s' "$RELEASE_JSON" | jq -er '.id') |
| 75 | |
| 76 | NAME=$(basename "$FILE") |
| 77 | curl -fsS -X POST "$API/releases/$RELEASE_ID/assets?name=$NAME" \ |
| 78 | -H "Authorization: token $TOKEN" \ |
| 79 | -F "attachment=@$FILE" |
| 80 | |
| 81 | |