Skip to content

Commit

Permalink
WORKFLOWS: Add some github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
RaumZeit committed Aug 22, 2024
1 parent bb9b05e commit 12cbd5e
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/dist_archives.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Make distribution archives

on:
workflow_dispatch:
inputs:
config-flags:
description: 'Configure flags to prepare the source directory'
default: ''
required: false
type: string
zip:
description: 'Additionally create ZIP archive next to default GZIP'
required: false
default: false
type: boolean
artifact-name:
description: 'Name of the artifact'
required: false
default: 'distribution-archives'
type: string
workflow_call:
inputs:
config-flags:
description: 'Configure flags to prepare the source directory'
default: ''
required: false
type: string
zip:
description: 'Additionally create ZIP archive next to default GZIP'
required: false
default: false
type: boolean
artifact-name:
description: 'Name of the artifact'
required: false
default: 'distribution-archives'
type: string
outputs:
version_number:
description: "The Version number of this build"
value: ${{ jobs.make_dist.outputs.version_number }}

jobs:
make_dist:
runs-on: ubuntu-latest
# Map the job outputs to step outputs
outputs:
version_number: ${{ steps.tarball.outputs.version_number }}

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get -y install \
build-essential \
autoconf \
automake \
gengetopt \
libtool
- name: Autotools setup
run: |
autoreconf -i
- name: Configure
run: ./configure ${{ inputs.config-flags }}
- name: Make tarball
id: tarball
run: |
make dist-gzip
version_number=$(ls RNAcode-*.tar.gz)
version_number="${version_number#RNAcode-}"
version_number="${version_number%.tar.gz}"
echo "version_number=${version_number}" >> "$GITHUB_OUTPUT"
- name: Make ZIP
if: ${{ inputs.zip }}
run: make dist-zip
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: |
RNAcode-*.tar.gz
RNAcode-*.zip
retention-days: 3
41 changes: 41 additions & 0 deletions .github/workflows/dist_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run distcheck

on:
workflow_dispatch:
inputs:
config-flags:
description: 'Configure flags to prepare the source directory'
default: ''
required: false
type: string
workflow_call:
inputs:
config-flags:
description: 'Configure flags to prepare the source directory'
default: ''
required: false
type: string

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get -y install \
build-essential \
autoconf \
automake \
gengetopt \
libtool
- name: Autotools setup
run: |
autoreconf -i
- name: Configure
run: ./configure ${{ inputs.config-flags }}
- name: distcheck
run: make distcheck
9 changes: 9 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Process Pull Request

on: pull_request

jobs:
run-distcheck:
uses: ./.github/workflows/dist_check.yaml


34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Version release

on:
push:
tags:
- 'v*.*'

jobs:
run-distcheck:
uses: ./.github/workflows/dist_check.yaml

create-dist-archives:
needs: run-distcheck
uses: ./.github/workflows/dist_archives.yaml
with:
zip: true
artifact-name: 'dist-archives'

create-release:
needs: [run-distcheck, create-dist-archives]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download source archives
uses: actions/download-artifact@v4
with:
name: dist-archives
- name: Make release
uses: ncipollo/release-action@v1
with:
artifacts: "RNAcode-*.tar.gz,RNAcode-*.zip"
name: "RNAcode ${{ needs.create-dist-archive.outputs.version_number }}"

0 comments on commit 12cbd5e

Please sign in to comment.