49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
name: continuous
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
continuous:
|
|
name: Publish continuous release
|
|
runs-on: nix
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Build Rust core
|
|
run: nix build .#aac --print-build-logs
|
|
|
|
- name: Package VPM zip
|
|
env:
|
|
VPM_VERSION: continuous
|
|
VPM_RELEASE_BASE: ${{ github.server_url }}/${{ github.repository }}/releases/download/continuous
|
|
run: nix develop -c bash ./vpm/package.sh
|
|
|
|
- name: Publish release and upload zip
|
|
env:
|
|
TOKEN: ${{ secrets.VPM_TOKEN || secrets.GITHUB_TOKEN }}
|
|
SERVER: ${{ github.server_url }}
|
|
REPO: ${{ github.repository }}
|
|
TAG: continuous
|
|
VPM_VERSION: continuous
|
|
run: nix develop -c bash ./vpm/publish.sh
|
|
|
|
# The index carries the zip's sha256, which only exists after packaging.
|
|
- name: Commit updated VPM index
|
|
env:
|
|
TOKEN: ${{ secrets.VPM_TOKEN || secrets.GITHUB_TOKEN }}
|
|
SERVER: ${{ github.server_url }}
|
|
REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
git config user.name gitea-actions
|
|
git config user.email actions@git.scug.io
|
|
git add vpm/index.json
|
|
git diff --cached --quiet && exit 0
|
|
git commit -m "vpm: continuous index update"
|
|
git push "https://x-access-token:$TOKEN@${SERVER#https://}/${REPO}.git" HEAD:main
|