diff --git a/.github/workflows/dist_archives.yaml b/.github/workflows/dist_archives.yaml new file mode 100644 index 0000000..dc22c19 --- /dev/null +++ b/.github/workflows/dist_archives.yaml @@ -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 diff --git a/.github/workflows/dist_check.yaml b/.github/workflows/dist_check.yaml new file mode 100644 index 0000000..7c06e68 --- /dev/null +++ b/.github/workflows/dist_check.yaml @@ -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 diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..de9a258 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,9 @@ +name: Process Pull Request + +on: pull_request + +jobs: + run-distcheck: + uses: ./.github/workflows/dist_check.yaml + + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..2fc834f --- /dev/null +++ b/.github/workflows/release.yaml @@ -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 }}"