Updated release-deb to run for branch 'release-actions' #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release-deb | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
branches: | |
# - master | |
# - main | |
- release-actions | |
paths-ignore: | |
- 'AUTHORS.md' | |
- 'LICENSE.md' | |
- 'README.md' | |
pull_request: | |
paths-ignore: | |
- 'AUTHORS.md' | |
- 'LICENSE.md' | |
- 'README.md' | |
jobs: | |
build: | |
timeout-minutes: 60 | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
name: ${{ matrix.os }} - ${{ matrix.fcompiler }} - ${{ matrix.build_type }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Linux | |
- os: ubuntu-latest | |
fcompiler: gfortran-12 | |
ccompiler: gcc-12 | |
shell: bash | |
build_type: debug | |
memcheck: false | |
- os: ubuntu-22.04 | |
fcompiler: gfortran-12 | |
ccompiler: gcc-12 | |
shell: bash | |
build_type: debug | |
memcheck: false | |
- os: ubuntu-20.04 | |
fcompiler: gfortran-12 | |
ccompiler: gcc-12 | |
shell: bash | |
build_type: debug | |
memcheck: false | |
defaults: | |
run: | |
shell: ${{ matrix.shell }} | |
steps: | |
# - uses: actions/checkout@v2 | |
# - name: create sample script | |
# run: | | |
# mkdir -p .debpkg/usr/bin | |
# mkdir -p .debpkg/usr/lib/samplescript | |
# echo -e "echo sample" > .debpkg/usr/bin/samplescript | |
# chmod +x .debpkg/usr/bin/samplescript | |
# echo -e "a=1" > .debpkg/usr/lib/samplescript/samplescript.conf | |
# # create DEBIAN directory if you want to add other pre/post scripts | |
# mkdir -p .debpkg/DEBIAN | |
# echo -e "echo postinst" > .debpkg/DEBIAN/postinst | |
# chmod +x .debpkg/DEBIAN/postinst | |
# - uses: jiro4989/build-deb-action@v3 | |
# with: | |
# package: samplescript | |
# package_root: .debpkg | |
# maintainer: your_name | |
# version: ${{ github.ref }} # refs/tags/v*.*.* | |
# arch: 'amd64' | |
# depends: 'libc6 (>= 2.2.1), git' | |
# desc: 'this is sample package.' | |
# homepage: 'https://github.com/jiro4989/build-deb-action' | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Show version information | |
run: | | |
${{ matrix.fcompiler }} --version | |
${{ matrix.ccompiler }} --version | |
- name: Build with Cmake | |
run: | | |
mkdir build | |
cd build | |
FC=${{ matrix.fcompiler }} CC=${{ matrix.ccompiler }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../ | |
make VERBOSE=1 | |
- name: Get version and architecture | |
run: | | |
echo "PACKAGE_VERSION=${GITHUB_REF#refs/tags/-v}" >> $GITHUB_ENV | |
echo "ARCH=${RUNNER_ARCH}" >> $GITHUB_ENV | |
- name: Build release directory | |
run: | | |
mkdir feq-parse_${{ env.PACKAGE_VERSION }}-1_${{ env.ARCH }} | |
cd feq-parse_${{ env.PACKAGE_VERSION }}-1_${{ env.ARCH }} | |
mkdir DEBIAN usr usr/local usr/local/include usr/local/lib | |
cp ../include/*.mod usr/local/include/*.mod | |
cp ../lib/*.so usr/local/lib/*.so | |
cp ../lib/*.a usr/local/lib/*.a | |
cat << EOF > DEBIAN/control | |
Package: feq-parse | |
Version: ${{ env.PACKAGE_VERSION }} | |
Section: libs | |
Priority: optional | |
Architecture: ${{ env.ARCH }} | |
Maintainer: Fluid Numerics LLC [email protected] | |
Description: An equation parser Fortran class that is used to interpret and evaluate functions provided as strings. | |
EOF | |
- name: Build .deb | |
run: | | |
dpkg --build . | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release v${{ env.PACKAGE_VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset (.deb) | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./feq-parse_${{ env.PACKAGE_VERSION }}-1_${{ env.ARCH }}.deb | |
asset_name: feq-parse_${{ env.PACKAGE_VERSION }}-1_${{ env.ARCH }}.deb | |
asset_content_type: application/vnd.debian.binary-package |