Skip to content

Commit

Permalink
adding rpm build scripts (#4)
Browse files Browse the repository at this point in the history
* adding rpm build scripts

* syntax fix

* reorganizing structure

* changing build path

* fixing path

* fixing path

* typo fix

* adding description to spec

* adding autoconf dep

* removing autoconf dependency

* debugging

* debugging

* adding setup

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* debugging

* finishing making changes

* syntax fix
  • Loading branch information
wjcunningham7 authored Apr 12, 2022
1 parent c447956 commit 9afcddc
Show file tree
Hide file tree
Showing 13 changed files with 5,553 additions and 15 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/buildrpm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright 2014-2022 Will Cunningham
#
# This file is part of FastMath.
#
# Licensed under the GNU General Public License 3.0 (the "License").
# A copy of the License may be obtained with this software package or at
#
# https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Use of this file is prohibited except in compliance with the License. Any
# modifications or derivative works of this file must retain this copyright
# notice, and modified files must contain a notice indicating that they have
# been altered from the originals.
#
# FastMath is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.

name: buildrpm

on:
workflow_run:
workflows: ["release"]
branches: [master]
types: [completed]

jobs:
buildrpm:
runs-on: ubuntu-latest
container: centos:centos7
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out head
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install rpmbuild
run: yum install -y rpm-build
- name: Read version
run: |
VERSION=`cat VERSION`
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build tarball
run: |
mkdir -p $HOME/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
mkdir fastmath-$VERSION
cp -r include configure LICENSE Makefile.in missing fastmath-$VERSION
tar cvzf fastmath-$VERSION.tar.gz fastmath-$VERSION
mv fastmath-$VERSION.tar.gz $HOME/rpmbuild/SOURCES
- name: Generate spec
run: |
bash ./build-rpm-spec.sh
mv fastmath.spec $HOME/rpmbuild/SPECS
- name: Build RPM
run: rpmbuild -bs $HOME/rpmbuild/SPECS/fastmath.spec
- name: Test RPM installation
run: rpm -ivvh $HOME/rpmbuild/SRPMS/fastmath-$VERSION-1.src.rpm
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: fastmath-${{ env.VERSION }}-1.src.rpm
asset_path: /github/home/rpmbuild/SRPMS/fastmath-${{ env.VERSION }}-1.src.rpm
asset_content_type: application/x-rpm
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2014-2022 Will Cunningham
#
# This file is part of FastMath.
#
# Licensed under the GNU General Public License 3.0 (the "License").
# A copy of the License may be obtained with this software package or at
#
# https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Use of this file is prohibited except in compliance with the License. Any
# modifications or derivative works of this file must retain this copyright
# notice, and modified files must contain a notice indicating that they have
# been altered from the originals.
#
# FastMath is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.

name: tests

on:
pull_request:
workflow_run:
workflows: [changelog]
types: [completed]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out head
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Run unit tests
run: echo "No unit tests!"
- name: Get latest release
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
if: github.ref == 'refs/heads/develop'
with:
semver_only: true
- name: Push to master
if: github.ref == 'refs/heads/develop'
run: |
MASTER_VERSION="$(echo ${{ steps.get-latest-tag.outputs.tag }} | cut -c2- )"
VERSION="$(cat ./VERSION)"
if [ "$MASTER_VERSION" = "$VERSION" ] ; then
echo "$VERSION has been previously released."
else
git config user.name "FastMathOpsBot"
git config user.email "fastmathopsbot@users.noreply.github.com"
git remote set-url origin https://${{ secrets.FASTMATH_OPS_BOT_TOKEN }}@github.com/wjcunningham7/fastmath.git
git push origin HEAD:master
fi
14 changes: 6 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,14 @@ aclocal.m4
AUTHORS
ChangeLog
config.*
configure
depcomp
install-sh
missing
NEWS
inc/stamp-h1
inc/config.h
inc/config.h.in
inc/config.h.in~
**/stamp-h1
**/config.h
**/config.h.in~
**/Makefile
**/Makefile.in
**/.deps/**
**/.dirstamp

# Build files
build/**
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

### Added

- Release, rpmbuild, and tests actions

## [1.1.0] - 2022-04-11

### Changed
Expand Down
File renamed without changes.
8 changes: 2 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ autom4te.cache,\
aclocal.m4,\
AUTHORS,\
ChangeLog,\
configure,\
configure~,\
install-sh,\
Makefile.in,\
missing,\
NEWS,\
$(sourcedir)/config.h.in,\
$(sourcedir)/config.h.in~\
$(sourcedir)/config.h.in~,\
$(sourcedir)/stamp-h1\
}
Loading

0 comments on commit 9afcddc

Please sign in to comment.