Skip to content

Commit

Permalink
Workflow for custom builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lhstrh committed Feb 18, 2024
1 parent 5ffbafd commit 150cf6a
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/custom-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Custom build

# Trigger the workflow every day at 5 AM (UTC).
on:
workflow_dispatch:

jobs:
custom-build:
runs-on: ubuntu-latest
steps:
- name: Check out lingua-franca repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Prepare build environment
uses: ./.github/actions/prepare-build-env
- name: Modify property file to contain the commit SHA
shell: bash
run: |
TIMESTAMP="$(date +'%Y-%m-%d')"
SHA="$(git rev-parse --short HEAD)"
sed --regexp-extended --in-place "s/^(VERSION = .*)$/\1 ${SHA} ${TIMESTAMP}/" core/src/main/resources/org/lflang/StringsBundle.properties
- name: Build and package lf cli tools (nightly build)
shell: bash
run: |
export TIMESTAMP="$(date +'%Y%m%d%H%M%S')"
echo "timestamp=$TIMESTAMP" >> "$GITHUB_ENV"
./gradlew build -Pnightly=$TIMESTAMP -PtargetOS=Linux -PtargetArch=x86_64
./gradlew assemble -Pnightly=$TIMESTAMP -PtargetOS=Linux -PtargetArch=aarch64
./gradlew assemble -Pnightly=$TIMESTAMP -PtargetOS=MacOS -PtargetArch=x86_64
./gradlew assemble -Pnightly=$TIMESTAMP -PtargetOS=MacOS -PtargetArch=aarch64
./gradlew assemble -Pnightly=$TIMESTAMP -PtargetOS=Windows -PtargetArch=x86_64
- name: Deploy nightly release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.NIGHTLY_BUILD }}"
automatic_release_tag: '${{ github.ref_name }}-${{ github.env.timestamp }}'
prerelease: true
draft: true
title: "Custom Lingua Franca build for ${{ github.ref_name }} branch"
files: |
build/distributions/*

0 comments on commit 150cf6a

Please sign in to comment.