Skip to content

Update ci.yml

Update ci.yml #17

Workflow file for this run

name: Artifacts
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-24.04-arm
arch: arm64
- os: macos-latest
arch: arm64
- os: windows-latest
arch: x86_64
fail-fast: false
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: dlang-community/setup-dlang@v2
with:
compiler: ldc-latest
- name: Build
run: |
dub build -b release-debug
- name: Rename artifact on Windows
if: runner.os == 'Windows'
run: |
dir
move build/redub.exe redub-${{ matrix.os }}-${{ matrix.arch }}.exe
- name: Rename artifact Unix
if: runner.os != 'Windows'
run: |
ls -R
mv build/redub redub-${{ matrix.os }}-${{ matrix.arch }}
- uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/main'
with:
name: redub-${{ matrix.os }}-${{ matrix.arch }}
path: redub-${{ matrix.os }}-${{ matrix.arch }}
# freebsd:
# strategy:
# matrix:
# arch: [x86_64]
# fail-fast: false
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Run FreeBSD VM
# uses: vmactions/freebsd-vm@v1
# with:
# usesh: true
# prepare: |
# pkg install -y dub ldc
# run: |
# dub build -b release
# - uses: actions/upload-artifact@v4
# if: github.ref == 'refs/heads/main'
# with:
# name: redub-freebsd-14.2-x86_64
# path: build
alpine:
strategy:
matrix:
arch: [x86_64]
fail-fast: false
runs-on: ubuntu-latest
container:
image: alpine:latest
defaults:
run:
shell: sh
steps:
- uses: actions/checkout@v4
- name: Prepare
run: |
apk update
apk add --no-cache ldc dub clang
- name: Build
run: |
dub build -b release-debug
- run: mv build/redub redub-alpine-x86_64
- uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/main'
with:
name: redub-alpine-x86_64
path: redub-alpine-x86_64
update-release:
runs-on: ubuntu-latest
needs: [build, alpine]
permissions:
contents: write
steps:
- name: "Download build artifacts"
uses: actions/[email protected]
with:
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R build
- name: "Update BuildAssets"
uses: ncipollo/release-action@v1
with:
artifacts: "redub-ubuntu-latest-x86_64,redub-ubuntu-24.04-arm-arm64,redub-macos-latest-arm64,redub-windows-latest-x86_64.exe,redub-alpine-x86_64"
allowUpdates: "true"
tag: "Build"