Fix: use git clone instead of actions/checkout (no Node in docker:latest)
This commit is contained in:
parent
9c483cedea
commit
7e1b4e7860
1 changed files with 11 additions and 48 deletions
|
|
@ -16,7 +16,11 @@ jobs:
|
|||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
run: |
|
||||
apk add --no-cache git
|
||||
git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
|
||||
"http://root:${{ secrets.PUSH_TOKEN }}@192.168.1.100:3000/${GITHUB_REPOSITORY}.git" .
|
||||
|
||||
- name: Determine version and tag
|
||||
id: vars
|
||||
|
|
@ -49,7 +53,7 @@ jobs:
|
|||
-t ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.vars.outputs.tag }} \
|
||||
.
|
||||
|
||||
if [ "${{ github.ref_name }}" = "main" ]; then
|
||||
if [ "${GITHUB_REF_NAME}" = "main" ]; then
|
||||
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.vars.outputs.tag }} \
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
||||
fi
|
||||
|
|
@ -58,7 +62,7 @@ jobs:
|
|||
run: |
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u root --password-stdin
|
||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.vars.outputs.tag }}
|
||||
if [ "${{ github.ref_name }}" = "main" ]; then
|
||||
if [ "${GITHUB_REF_NAME}" = "main" ]; then
|
||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
||||
fi
|
||||
|
||||
|
|
@ -106,45 +110,6 @@ jobs:
|
|||
docker ps --filter name="$CONTAINER_NAME"
|
||||
docker image prune -f || true
|
||||
|
||||
electron-build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: deploy
|
||||
if: github.ref_name == 'main'
|
||||
container:
|
||||
image: docker:latest
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build Electron app
|
||||
run: |
|
||||
VERSION=$(cat VERSION 2>/dev/null || echo "0.0.0")
|
||||
CONTAINER_NAME="gaming-hub"
|
||||
|
||||
apk add --no-cache nodejs npm
|
||||
cd electron
|
||||
node -e "
|
||||
const pkg = require('./package.json');
|
||||
pkg.version = '${VERSION}';
|
||||
require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
|
||||
"
|
||||
npm ci --no-audit --no-fund
|
||||
npx electron-forge make --platform win32 --arch x64
|
||||
|
||||
SRC_DIR="out/make/squirrel.windows/x64"
|
||||
docker exec "$CONTAINER_NAME" mkdir -p /data/downloads
|
||||
docker cp "${SRC_DIR}/RELEASES" "${CONTAINER_NAME}:/data/downloads/RELEASES"
|
||||
|
||||
for f in ${SRC_DIR}/*.nupkg; do
|
||||
docker cp "$f" "${CONTAINER_NAME}:/data/downloads/$(basename "$f")"
|
||||
done
|
||||
|
||||
SETUP_EXE=$(ls ${SRC_DIR}/*Setup*.exe 2>/dev/null | head -1)
|
||||
if [ -n "$SETUP_EXE" ]; then
|
||||
docker cp "$SETUP_EXE" "${CONTAINER_NAME}:/data/downloads/GamingHub-Setup.exe"
|
||||
fi
|
||||
|
||||
bump-version:
|
||||
runs-on: ubuntu-latest
|
||||
needs: deploy
|
||||
|
|
@ -152,13 +117,11 @@ jobs:
|
|||
container:
|
||||
image: alpine/git:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.PUSH_TOKEN }}
|
||||
|
||||
- name: Bump patch version
|
||||
- name: Checkout and bump
|
||||
run: |
|
||||
git clone --branch main --depth 5 \
|
||||
"http://root:${{ secrets.PUSH_TOKEN }}@192.168.1.100:3000/${GITHUB_REPOSITORY}.git" repo
|
||||
cd repo
|
||||
git config user.name "Forgejo CI"
|
||||
git config user.email "ci@adriahub.de"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue