Skip to content

Nar

Nar #37

Workflow file for this run

name: Nar
on:
workflow_dispatch:
# trigger this workflow on push of a release tag
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Push events to matching release tags, i.e. 0.8.4
jobs:
build-macos:
name: Build on macOS (x86_64 and aarch64)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-14-arm64]
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: |
brew update
brew install automake autoconf libtool
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Build and test the package
run: make compile-macosx
- name: Store the build arctifacts
uses: actions/upload-artifact@v3
with:
name: macos-build
path: target/nar/louis-*
build-windows:
name: Build for Windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install texinfo libc6-dev-i386 mingw-w64
- name: Build and test the package for x86_64
run: mvn test -Pcross-compile -Dhost.os=w64-mingw32 -Dos.arch=x86_64
- name: Build and test the package for i686
run: mvn test -Pcross-compile -Dhost.os=w64-mingw32 -Dos.arch=i686
- name: Store the build arctifacts
uses: actions/upload-artifact@v3
with:
name: windows-build
path: target/nar/louis-*
build-linux:
name: Build for Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Build and test the package
run: mvn test
- name: Install i386 build dependencies
run: |
sudo apt-get update
sudo apt-get install libc6-dev-i386
- name: Build and test the package for i386
run: mvn test -Dos.arch=i386
- name: Store the build arctifacts
uses: actions/upload-artifact@v3
with:
name: linux-build
path: target/nar/louis-*
nar:
name: Package nar and publish
needs: [build-macos, build-windows, build-linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: windows-build
path: target/nar
- uses: actions/download-artifact@v3
with:
name: macos-build
path: target/nar
- uses: actions/download-artifact@v3
with:
name: linux-build
path: target/nar
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build the nar and publish
run: mvn --batch-mode nar:nar-prepare-package nar:nar-package jar:jar gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy -DnexusUrl=https://oss.sonatype.org/ -DserverId=sonatype-nexus-staging -DkeepStagingRepositoryOnCloseRuleFailure=true
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}