Skip to content

Commit 12cbd5e

Browse files
committed
WORKFLOWS: Add some github workflows
1 parent bb9b05e commit 12cbd5e

4 files changed

Lines changed: 169 additions & 0 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Make distribution archives
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
config-flags:
7+
description: 'Configure flags to prepare the source directory'
8+
default: ''
9+
required: false
10+
type: string
11+
zip:
12+
description: 'Additionally create ZIP archive next to default GZIP'
13+
required: false
14+
default: false
15+
type: boolean
16+
artifact-name:
17+
description: 'Name of the artifact'
18+
required: false
19+
default: 'distribution-archives'
20+
type: string
21+
workflow_call:
22+
inputs:
23+
config-flags:
24+
description: 'Configure flags to prepare the source directory'
25+
default: ''
26+
required: false
27+
type: string
28+
zip:
29+
description: 'Additionally create ZIP archive next to default GZIP'
30+
required: false
31+
default: false
32+
type: boolean
33+
artifact-name:
34+
description: 'Name of the artifact'
35+
required: false
36+
default: 'distribution-archives'
37+
type: string
38+
outputs:
39+
version_number:
40+
description: "The Version number of this build"
41+
value: ${{ jobs.make_dist.outputs.version_number }}
42+
43+
jobs:
44+
make_dist:
45+
runs-on: ubuntu-latest
46+
# Map the job outputs to step outputs
47+
outputs:
48+
version_number: ${{ steps.tarball.outputs.version_number }}
49+
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
- name: Install prerequisites
54+
run: |
55+
sudo apt-get update
56+
sudo apt-get -y install \
57+
build-essential \
58+
autoconf \
59+
automake \
60+
gengetopt \
61+
libtool
62+
- name: Autotools setup
63+
run: |
64+
autoreconf -i
65+
- name: Configure
66+
run: ./configure ${{ inputs.config-flags }}
67+
- name: Make tarball
68+
id: tarball
69+
run: |
70+
make dist-gzip
71+
version_number=$(ls RNAcode-*.tar.gz)
72+
version_number="${version_number#RNAcode-}"
73+
version_number="${version_number%.tar.gz}"
74+
echo "version_number=${version_number}" >> "$GITHUB_OUTPUT"
75+
- name: Make ZIP
76+
if: ${{ inputs.zip }}
77+
run: make dist-zip
78+
- name: Upload artifacts
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: ${{ inputs.artifact-name }}
82+
path: |
83+
RNAcode-*.tar.gz
84+
RNAcode-*.zip
85+
retention-days: 3

.github/workflows/dist_check.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run distcheck
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
config-flags:
7+
description: 'Configure flags to prepare the source directory'
8+
default: ''
9+
required: false
10+
type: string
11+
workflow_call:
12+
inputs:
13+
config-flags:
14+
description: 'Configure flags to prepare the source directory'
15+
default: ''
16+
required: false
17+
type: string
18+
19+
jobs:
20+
check:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
- name: Install prerequisites
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get -y install \
30+
build-essential \
31+
autoconf \
32+
automake \
33+
gengetopt \
34+
libtool
35+
- name: Autotools setup
36+
run: |
37+
autoreconf -i
38+
- name: Configure
39+
run: ./configure ${{ inputs.config-flags }}
40+
- name: distcheck
41+
run: make distcheck
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Process Pull Request
2+
3+
on: pull_request
4+
5+
jobs:
6+
run-distcheck:
7+
uses: ./.github/workflows/dist_check.yaml
8+
9+

.github/workflows/release.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Version release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*'
7+
8+
jobs:
9+
run-distcheck:
10+
uses: ./.github/workflows/dist_check.yaml
11+
12+
create-dist-archives:
13+
needs: run-distcheck
14+
uses: ./.github/workflows/dist_archives.yaml
15+
with:
16+
zip: true
17+
artifact-name: 'dist-archives'
18+
19+
create-release:
20+
needs: [run-distcheck, create-dist-archives]
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Download source archives
27+
uses: actions/download-artifact@v4
28+
with:
29+
name: dist-archives
30+
- name: Make release
31+
uses: ncipollo/release-action@v1
32+
with:
33+
artifacts: "RNAcode-*.tar.gz,RNAcode-*.zip"
34+
name: "RNAcode ${{ needs.create-dist-archive.outputs.version_number }}"

0 commit comments

Comments
 (0)