Skip to content

Commit

Permalink
chore(ci) better build (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
helderbetiol authored Jan 5, 2024
1 parent 3099a35 commit 9a293f6
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 1,134 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build/CLI/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
shell: bash
run: |
cd CLI
make main && make mac && make win
make allos
- name: Upload result for job
uses: actions/upload-artifact@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
shell: bash
run: |
cd BACK/app/
go build -o ogree_app_backend
make allos
- name: Send to Nextcloud
shell: bash
Expand All @@ -33,7 +33,7 @@ runs:
run: |
curl -u $NEXT_CREDENTIALS -X MKCOL $NEXT_ADDR
zip -r OGrEE_APP_Backend_Linux.zip deploy/ \
zip -r OGrEE_APP_Backend.zip deploy/ \
BACK/app/
curl -u $NEXT_CREDENTIALS -T OGrEE_APP_Backend_Linux.zip $NEXT_ADDR/OGrEE_APP_Backend_Linux.zip
curl -u $NEXT_CREDENTIALS -T OGrEE_APP_Backend.zip $NEXT_ADDR/OGrEE_APP_Backend.zip
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Flutter Publish
description: Publish Flutter app on Nexcloud
name: Flutter Web Publish
description: Publish Flutter webapp on Nextcloud

inputs:
VERSION:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build multi-Docker and Push to Registery
description: Build multi-Docker and Push to Registery
name: Build multi-platform and publish
description: Build multi-platform (docker and binaries) and publish to registry or Nextcloud

inputs:
ENVIRONMENT:
Expand Down Expand Up @@ -86,26 +86,26 @@ runs:
TEAM_USERNAME: ${{ inputs.TEAM_USERNAME }}
TEAM_PASSWORD: ${{ inputs.TEAM_PASSWORD }}

- name: Publish API on Nexcloud
- name: ⚙️ Build & Publish API binary on Nextcloud
uses: ./.github/actions/build/API
with:
VERSION: ${{ env.VERSION }}
NEXT_CREDENTIALS: ${{ inputs.NEXT_CREDENTIALS }}

- name: Publish CLI on Nexcloud
- name: ⚙️ Build & Publish CLI binary on Nextcloud
uses: ./.github/actions/build/CLI
with:
VERSION: ${{ env.VERSION }}
NEXT_CREDENTIALS: ${{ inputs.NEXT_CREDENTIALS }}

- name: Publish Flutter Desktop on Nexcloud
uses: ./.github/actions/build/flutter-app/linux
- name: ⚙️ Build & Publish APP Web on Nextcloud
uses: ./.github/actions/build/flutter-app
with:
VERSION: ${{ env.VERSION }}
NEXT_CREDENTIALS: ${{ inputs.NEXT_CREDENTIALS }}

- name: Publish back-app on Nexcloud
uses: ./.github/actions/build/back-app/linux
- name: ⚙️ Build & Publish BACK binary on Nextcloud
uses: ./.github/actions/build/back-app
with:
VERSION: ${{ env.VERSION }}
NEXT_CREDENTIALS: ${{ inputs.NEXT_CREDENTIALS }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/utils/wait-job/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
JOB_PATH:
description: "Name of the job to wait for"
required: false
default: ".github/workflows/build-docker-deploy.yaml"
default: ".github/workflows/build-deploy.yaml"
BRANCH:
description: "Branch to wait for"
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api-unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow will build the golang project, create a Mongo database and test it

name: API Unit Tests
name: 🕵️‍♂️ API Unit Tests

on:
push:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
workflow_call:

jobs:
build-docker:
name: 🏗️📤 Build Docker Image - Push to Registery
build-publish:
name: 🏗️📤 Build Multi-Platform - Publish
runs-on: ubuntu-latest
steps:

Expand All @@ -28,10 +28,10 @@ jobs:
echo "ENVIRONMENT=Release Candidate" >> $GITHUB_ENV
fi
- name: 🏗️📤 Build Docker Image - Push to Registery
id: build-docker-deploy
- name: 🏗️📤 Build Multi-Platform - Publish
id: build-deploy
if: contains("release",${{ github.ref_name }})
uses: ./.github/actions/build/multi-docker
uses: ./.github/actions/build/multi-platform
with:
ENVIRONMENT: ${{ env.ENVIRONMENT }}
TEAM_DOCKER_URL: ${{ secrets.TEAM_DOCKER_URL }}
Expand All @@ -40,9 +40,9 @@ jobs:
NEXT_CREDENTIALS: ${{ secrets.NEXT_CREDENTIALS }}

build-app-windows:
name: 🏗️📤 Build APP and Installer for Windows
name: 🏗️📤 Build Windows Installer - Publish
permissions: write-all
needs: build-docker
needs: build-publish
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -58,7 +58,7 @@ jobs:
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: 🏗️📤 Build app and create installer
- name: 🏗️📤 Build WinAPP + WinInstaller - Publish
uses: ./.github/actions/build/windows
with:
VERSION: ${{ env.VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
paths:
- CLI/**

name: CLI Unit Tests
name: 🕵️‍♂️ CLI Unit Tests

jobs:
cli-unit-test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flutter-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Flutter
name: 🕵️‍♂️ Flutter Unit Tests

on:
push:
Expand Down
2 changes: 2 additions & 0 deletions BACK/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ogree_app_backend*
tenants.json
39 changes: 39 additions & 0 deletions BACK/app/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# '$$' refers to shell variable not make variable
# https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_6.html
GOPATH=$(shell go env GOPATH)

BUILD_COMMAND=go build

LINUX_COMMAND=GOOS=linux $(BUILD_COMMAND) -o ogree_app_backend
MAC_COMMAND=GOOS=darwin $(BUILD_COMMAND) -o ogree_app_backend.mac
WIN_COMMAND=GOOS=windows $(BUILD_COMMAND) -o ogree_app_backend.exe
CROSS_COMMAND=$(LINUX_COMMAND) ; $(MAC_COMMAND) ; $(WIN_COMMAND)
DOCKER_PREFIX=docker run --rm -v $(shell pwd):/workdir -w /workdir golang:1.20 bash -c

.PHONY: main mac win linux allos

main:
eval $(BUILD_COMMAND)
mac:
eval $(MAC_COMMAND)
win:
eval $(WIN_COMMAND)
linux:
eval $(LINUX_COMMAND)
allos:
eval $(MAC_COMMAND)
eval $(WIN_COMMAND)
eval $(LINUX_COMMAND)

docker:
$(DOCKER_PREFIX) "$(LINUX_COMMAND)"
dockermac:
$(DOCKER_PREFIX) "$(MAC_COMMAND)"
dockerwin:
$(DOCKER_PREFIX) "$(WIN_COMMAND)"
dockercross:
$(DOCKER_PREFIX) "$(CROSS_COMMAND)"

clean:
rm ogree_app_backend*

16 changes: 0 additions & 16 deletions BACK/app/tenants.json

This file was deleted.

Loading

0 comments on commit 9a293f6

Please sign in to comment.