init
This commit is contained in:
69
.github/workflows/build.yaml
vendored
Normal file
69
.github/workflows/build.yaml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
name: Build Electron
|
||||
run-name: Build Electron
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Build Dockerfile
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker
|
||||
volumes:
|
||||
- /tmp/gitea:/tmp/gitea
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: ztimson/actions/clone@develop
|
||||
|
||||
- name: Get Version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(cat server/package.json | grep version | grep -Eo '[0-9][[:alnum:]\.\/\-]+')
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo $VERSION
|
||||
|
||||
- name: Build Image
|
||||
run: |
|
||||
cd electron
|
||||
REGISTRY=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%%)
|
||||
docker build -t "$REGISTRY/momentum/electron-builder:${{github.ref_name}}" .
|
||||
|
||||
- name: Publish Branch Tag
|
||||
run: |
|
||||
REGISTRY=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%%)
|
||||
docker login -u ${{github.repository_owner}} -p ${{secrets.DEPLOY_TOKEN}} $REGISTRY
|
||||
docker push "$REGISTRY/momentum/electron-builder:${{github.ref_name}}"
|
||||
|
||||
- name: Publish Latest Tag
|
||||
run: |
|
||||
if [ "${{github.ref_name}}" = "master" ]; then
|
||||
REGISTRY=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%%)
|
||||
docker tag "$REGISTRY/momentum/electron-builder:${{github.ref_name}}" "$REGISTRY/momentum/electron-builder:latest"
|
||||
docker push "$REGISTRY/momentum/electron-builder:latest"
|
||||
fi
|
||||
|
||||
electron:
|
||||
name: Build Electron
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- docker
|
||||
container:
|
||||
image: git.zakscode.com/momentum/electron-builder:latest
|
||||
env:
|
||||
VERSION: ${{ needs.docker.outputs.version }}
|
||||
steps:
|
||||
- name: Build inside container
|
||||
run: |
|
||||
if [ "${{github.ref_name}}" = "master" ]; then
|
||||
/app/entrypoint.sh
|
||||
ls /out
|
||||
curl -X PUT -H "Authorization: token ${{ secrets.DEPLOY_TOKEN }}" --upload-file /out/Momentum-darwin-x64.zip \
|
||||
https://git.zakscode.com/api/packages/momentum/generic/electron/${{ env.VERSION }}/Momentum-darwin-x64.zip
|
||||
curl -X PUT -H "Authorization: token ${{ secrets.DEPLOY_TOKEN }}" --upload-file /out/Momentum-linux-x64.zip \
|
||||
https://git.zakscode.com/api/packages/momentum/generic/electron/${{ env.VERSION }}/Momentum-linux-x64.zip
|
||||
curl -X PUT -H "Authorization: token ${{ secrets.DEPLOY_TOKEN }}" --upload-file /out/Momentum-win32-x64.zip \
|
||||
https://git.zakscode.com/api/packages/momentum/generic/electron/${{ env.VERSION }}/Momentum-win32-x64.zip
|
||||
fi
|
||||
Reference in New Issue
Block a user