Skip to content

fix(ci): support rebuilding existing releases #15

fix(ci): support rebuilding existing releases

fix(ci): support rebuilding existing releases #15

Workflow file for this run

name: build
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Setup Go
uses: actions/setup-go@v7.0.0
with:
go-version-file: go.mod
- name: Install test dependencies
run: sudo apt-get update && sudo apt-get install --yes libfuse-dev
- name: Test
run: go test ./...
build:
needs: test
strategy:
matrix:
include:
- group: xgo
targets: darwin-amd64,darwin-arm64,windows-amd64
- group: musl
targets: linux-arm64-musl,linux-amd64-musl
- group: windows-arm64
targets: windows-arm64
- group: android-arm64
targets: android-arm64
name: Build (${{ matrix.group }})
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Setup Go
uses: actions/setup-go@v7.0.0
with:
go-version-file: go.mod
- name: Setup web
run: bash build.sh dev web
- name: Build
uses: go-cross/cgo-actions@v1.1.0
with:
targets: ${{ matrix.targets }}
musl-target-format: $os-$musl-$arch
out-dir: build
x-flags: |
github.com/AlliotTech/openalist/internal/conf.BuiltAt=$built_at
github.com/AlliotTech/openalist/internal/conf.GitAuthor=Xhofe
github.com/AlliotTech/openalist/internal/conf.GitCommit=$git_commit
github.com/AlliotTech/openalist/internal/conf.Version=$tag
github.com/AlliotTech/openalist/internal/conf.WebVersion=dev
- name: Upload artifact
uses: actions/upload-artifact@v7.0.1
with:
name: alist_${{ matrix.group }}
path: build/*
if-no-files-found: error
retention-days: 3