Skip to content

chore: update ci

chore: update ci #7

---
name: build-torrserver
#on:
# release:
# types: [published]
on: [push, pull_request]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: tag number
run : echo ${{ github.event.release.tag_name }}
- name: Checkout
uses: actions/[email protected]
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- uses: actions/setup-go@v5
with:
go-version: '^1.21.2'
# - name: Set up QEMU
# uses: docker/[email protected]
# - name: Set up Docker Buildx
# uses: docker/[email protected]
# - name: Login to GitHub Container Registry
# uses: docker/[email protected]
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: set lower case owner name
run: |
echo "REG_REPO=${REPO,,}" >>${GITHUB_ENV}
env:
REPO: '${{ github.repository }}'
- name: Set env
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
- name: Get latest TorrServer version
run: |
export TS_VERSION="$(curl -sL https://api.github.com/repos/YouROK/TorrServer/releases/latest | jq -r '.tag_name')"
echo "TS_VERSION=${TS_VERSION}" >> ${GITHUB_ENV}
- name: CHECK ENVS
run: |
echo TS_VERSION=${{ env.TS_VERSION }}
- name: Prepare TorrServer source
working-directory: ./torrserver/.build
run: |
git clone --depth 1 --branch $TS_VERSION https://github.com/YouROK/TorrServer.git
cp ./build-all.sh ./TorrServer/build-all.sh
- name: Run build
working-directory: ./torrserver/.build/TorrServer
run: |
./build-all.sh
- name: Check builds
working-directory: ./torrserver
run: |
rm -rf ./assets
cp ./.build/TorrServer/dist ./assets
- uses: EndBug/add-and-commit@v9
with:
add: ./torrserver/assets
message: 'chore: Added TorrServer assets'
# - name: Build and push
# uses: docker/[email protected]
# with:
# context: .
# platforms: linux/amd64,linux/arm/v7,linux/arm64
# push: true
# tags: |
# ghcr.io/${{ env.REG_REPO }}:${{ github.event.release.tag_name }}
# ghcr.io/${{ env.REG_REPO }}:latest