Setup workflows for forgejo
Some checks failed
Build docker images / build (push) Has been cancelled

This commit is contained in:
Ethan O'Brien 2024-07-21 16:23:54 -05:00
parent 5c3b8e936c
commit 8a0c8c1728
2 changed files with 8 additions and 143 deletions

View file

@ -1,22 +1,18 @@
# GitHub actions workflow which builds and publishes the docker images.
name: Build docker images name: Build docker images
on: on:
push: push:
tags: ["v*"]
branches: [ main ] branches: [ main ]
workflow_dispatch:
permissions:
contents: read
packages: write
id-token: write # needed for signing the images with GitHub OIDC Token
jobs: jobs:
build: build:
if: github.repository == 'ethanaobrien/ew'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Set up QEMU - name: Set up QEMU
id: qemu id: qemu
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
@ -27,18 +23,7 @@ jobs:
id: buildx id: buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Inspect builder
run: docker buildx inspect
- name: Install Cosign
uses: sigstore/cosign-installer@v3.5.0
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract version from Cargo.toml - name: Extract version from Cargo.toml
# Note: explicitly requesting bash will mean bash is invoked with `-eo pipefail`, see
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
shell: bash shell: bash
run: | run: |
echo "EW_VERSION=$(grep "^version" Cargo.toml | sed -E 's/version\s*=\s*["]([^"]*)["]/\1/')" >> $GITHUB_ENV echo "EW_VERSION=$(grep "^version" Cargo.toml | sed -E 's/version\s*=\s*["]([^"]*)["]/\1/')" >> $GITHUB_ENV
@ -58,7 +43,7 @@ jobs:
flavor: | flavor: |
latest=false latest=false
tags: | tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=raw,value=latest
- name: Build and push all platforms - name: Build and push all platforms
id: build-and-push id: build-and-push

View file

@ -1,120 +0,0 @@
name: Rust Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-x86_64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies and build webui
run: |
cd webui
npm install
npm run build
rustup target add x86_64-pc-windows-msvc
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build Rust project for x86_64
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Archive production artifacts for x86_64
uses: actions/upload-artifact@v3
with:
name: Linux_x86_64
path: target/x86_64-unknown-linux-gnu/release/ew
build-aarch64:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
arch: [aarch64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies and build webui
run: |
cd webui
npm install
npm run build
cd ..
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build Rust project for aarch64
run: cargo build --release
- name: Archive production artifacts for aarch64
uses: actions/upload-artifact@v3
with:
name: Linux_aarch64
path: target/release/ew
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies and build webui
run: |
cd webui
npm install
npm run build
cd ..
rustup target add x86_64-pc-windows-msvc
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build Rust project for Windows
run: cargo build --release --target x86_64-pc-windows-msvc
- name: Archive production artifacts for Windows
uses: actions/upload-artifact@v3
with:
name: Windows_x86_64
path: target\x86_64-pc-windows-msvc\release\ew.exe