From e56bf6becf7622ae478ebc4be8bc536e03b999bc Mon Sep 17 00:00:00 2001 From: Bhasher Date: Sat, 13 Jan 2024 22:47:31 +0100 Subject: [PATCH] Merge gitea actions release workflows --- .gitea/workflows/backend.yaml | 49 --------------- .gitea/workflows/both.yaml | 49 --------------- .gitea/workflows/desktop.yaml | 56 ----------------- .gitea/workflows/frontend.yaml | 49 --------------- .gitea/workflows/release.yaml | 112 +++++++++++++++++++++++++++++++++ 5 files changed, 112 insertions(+), 203 deletions(-) delete mode 100644 .gitea/workflows/backend.yaml delete mode 100644 .gitea/workflows/both.yaml delete mode 100644 .gitea/workflows/desktop.yaml delete mode 100644 .gitea/workflows/frontend.yaml create mode 100644 .gitea/workflows/release.yaml diff --git a/.gitea/workflows/backend.yaml b/.gitea/workflows/backend.yaml deleted file mode 100644 index 4e20223..0000000 --- a/.gitea/workflows/backend.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Backend docker image -run-name: ${{ gitea.actor }} is runs ci pipeline -on: - push: - tags: - - "v*" - -jobs: - release-image: - runs-on: ubuntu-latest - container: - image: catthehacker/ubuntu:act-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Extract tag - uses: olegtarasov/get-tag@v2.1.2 - id: tagName - with: - tagRegex: "v(.*)" - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - config-inline: | - [registry."git.bhasher.com"] - http = true - insecure = true - - - name: Login - uses: docker/login-action@v2 - with: - registry: git.bhasher.com - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push frontend - uses: docker/build-push-action@v5 - with: - context: ./backend - file: ./backend/Dockerfile - push: true - platforms: | - linux/amd64 - linux/arm64 - tags: | - git.bhasher.com/bhasher/focus-backend:latest - git.bhasher.com/bhasher/focus-backend:${{ steps.tagName.outputs.tag }} diff --git a/.gitea/workflows/both.yaml b/.gitea/workflows/both.yaml deleted file mode 100644 index 863a181..0000000 --- a/.gitea/workflows/both.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Frontend and backend docker image -run-name: ${{ gitea.actor }} is runs ci pipeline -on: - push: - tags: - - "v*" - -jobs: - release-image: - runs-on: ubuntu-latest - container: - image: catthehacker/ubuntu:act-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Extract tag - uses: olegtarasov/get-tag@v2.1.2 - id: tagName - with: - tagRegex: "v(.*)" - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - config-inline: | - [registry."git.bhasher.com"] - http = true - insecure = true - - - name: Login - uses: docker/login-action@v2 - with: - registry: git.bhasher.com - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push frontend - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - push: true - platforms: | - linux/amd64 - linux/arm64 - tags: | - git.bhasher.com/bhasher/focus:latest - git.bhasher.com/bhasher/focus:${{ steps.tagName.outputs.tag }} diff --git a/.gitea/workflows/desktop.yaml b/.gitea/workflows/desktop.yaml deleted file mode 100644 index 228729b..0000000 --- a/.gitea/workflows/desktop.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Tauri based desktop app - -on: - push: - tags: - - "v*" - -jobs: - publish-tauri-desktop: - runs-on: ubuntu-latest - container: - image: catthehacker/ubuntu:act-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Extract tag - uses: olegtarasov/get-tag@v2.1.2 - id: tagName - with: - tagRegex: "v(.*)" - - - name: Set up node - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install Rust stable - uses: dtolnay/rust-toolchain@stable - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf - - - name: Install frontend dependencies - run: | - cd frontend - npm install - cd .. - - - name: Build desktop app - run: | - cd frontend - npm run tauri build - cd .. - - - name: Publish desktop app - uses: akkuman/gitea-release-action@v1 - with: - name: Focus ${{ steps.tagName.outputs.tag }} - prerelease: true - files: |- - frontend/src-tauri/target/release/focus - frontend/src-tauri/target/release/bundle/deb/*.deb - frontend/src-tauri/target/release/bundle/appimage/*.AppImage diff --git a/.gitea/workflows/frontend.yaml b/.gitea/workflows/frontend.yaml deleted file mode 100644 index ed3c6a9..0000000 --- a/.gitea/workflows/frontend.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Frontend docker image -run-name: ${{ gitea.actor }} is runs ci pipeline -on: - push: - tags: - - "v*" - -jobs: - release-image: - runs-on: ubuntu-latest - container: - image: catthehacker/ubuntu:act-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Extract tag - uses: olegtarasov/get-tag@v2.1.2 - id: tagName - with: - tagRegex: "v(.*)" - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - config-inline: | - [registry."git.bhasher.com"] - http = true - insecure = true - - - name: Login - uses: docker/login-action@v2 - with: - registry: git.bhasher.com - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push frontend - uses: docker/build-push-action@v5 - with: - context: ./frontend - file: ./frontend/Dockerfile - push: true - platforms: | - linux/amd64 - linux/arm64 - tags: | - git.bhasher.com/bhasher/focus-frontend:latest - git.bhasher.com/bhasher/focus-frontend:${{ steps.tagName.outputs.tag }} diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..5c59626 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,112 @@ +name: Build releases +run-name: ${{ gitea.actor }} is runs ci pipeline +on: + push: + tags: + - "v*" + +jobs: + build-docker: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + strategy: + matrix: + include: + - context: ./backend + image: focus-backend + - context: ./frontend + dockerfile: ./frontend/Dockerfile + image: focus-frontend + - context: . + image: focu + env: + RUNNER_TOOL_CACHE: /toolcaches + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract tag + uses: olegtarasov/get-tag@v2.1.2 + id: tagName + with: + tagRegex: "v(.*)" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + config-inline: | + [registry."git.bhasher.com"] + http = true + insecure = true + + - name: Login + uses: docker/login-action@v2 + with: + registry: git.bhasher.com + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push ${{ matrix.image }} + uses: docker/build-push-action@v5 + with: + context: ${{ matrix.context }} + file: ${{ matrix.context }}/Dockerfile + push: true + platforms: | + linux/amd64 + linux/arm64 + tags: | + git.bhasher.com/bhasher/${{ matrix.image }}:latest + git.bhasher.com/bhasher/${{ matrix.image }}:${{ steps.tagName.outputs.tag }} + + build-tauri: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract tag + uses: olegtarasov/get-tag@v2.1.2 + id: tagName + with: + tagRegex: "v(.*)" + + - name: Set up node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf + + - name: Install frontend dependencies + run: | + cd frontend + npm install + cd .. + + - name: Build desktop app + run: | + cd frontend + npm run tauri build + cd .. + + - name: Publish desktop app + uses: akkuman/gitea-release-action@v1 + with: + name: Focus ${{ steps.tagName.outputs.tag }} + prerelease: true + files: |- + frontend/src-tauri/target/release/focus + frontend/src-tauri/target/release/bundle/deb/*.deb + frontend/src-tauri/target/release/bundle/appimage/*.AppImage