Skip to content

Update: Using real tags now #110

Update: Using real tags now

Update: Using real tags now #110

Workflow file for this run

name: Artifacts
on:
pull_request:
push:
branches:
- main
tags:
- 'v*'
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: Upload artifacts on Windows
uses: actions/upload-artifact@v4
if: runner.os == 'Windows'
with:
name: redub-windows-latest-x86_64.exe
path: redub-windows-latest-x86_64.exe
- name: Rename artifact Unix
if: runner.os != 'Windows'
run: |
ls -R
mv build/redub redub-${{ matrix.os }}-${{ matrix.arch }}
- name: Upload artifacts on Unix
uses: actions/upload-artifact@v4
if: runner.os != 'Windows' && 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/download-artifact@v4.1.8
with:
merge-multiple: true
# - uses: actions/checkout@v4
# - name: Fetch all tags
# run: git fetch --tags
# - name: "Get latest tag"
# run: echo "TAG=$(git describe --tags --abbrev=0) >> $GITHUB_ENV"
- name: Display structure of downloaded files
run: ls -R
- name: Publish release
uses: ncipollo/release-action@v1
with:
artifacts: "redub-*"
allowUpdates: "true"
tag: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'nightly' }}
name: ${{ startsWith(github.ref, 'refs/tags/') && format('Redub {0}', github.ref_name) || 'Redub Nightly' }}
prerelease: ${{ startsWith(github.ref, 'refs/tags/') && 'false' || 'true' }}