Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
39b31a3
ci: add get-newest-artifact composite action
bunbry Nov 7, 2024
c5219bf
WIP ci: add build & deploy workflows for AKTIN Maven, Debian, and Doc…
bunbry Nov 7, 2024
85c4901
WIP fix: workflows must be rooted in .github/workflows directory
bunbry Nov 7, 2024
616c077
feat: set "downloads" cache key based on versions file
bunbry Dec 17, 2024
f827f79
refactor!: remove steps related to i2b2 download
bunbry Dec 17, 2024
e324e43
refactor: remove passphrase authentication for SSH
bunbry Dec 17, 2024
12d5c9f
refactor: update remote address for debian deployment
bunbry Dec 17, 2024
a6a7ae5
fix: actually make use of cached AKTIN repo public key
bunbry Dec 17, 2024
029f89d
refactor!: rename input for debian-build.yml
bunbry Dec 17, 2024
d5f125e
refactor: uncomment pre-testing installation steps
bunbry Dec 18, 2024
f088ec0
refactor: add REPREPRO_HOME value
bunbry Dec 18, 2024
0221560
docs: correct workflow directory in example
bunbry Dec 18, 2024
4225431
fix(debian build): remove build script version parameter
bunbry Jan 8, 2025
57015cd
refactor(debian build): remove installation and testing steps
bunbry Jan 8, 2025
5274501
refactor(debian build): exclude lines starting with # from cache name
bunbry Jan 8, 2025
88db8c8
refactor(debian build): use version from versions file instead of git…
bunbry Jan 8, 2025
2b6cb8f
refactor(debian deploy): remove manipulation of the distributions file
bunbry Jan 8, 2025
fcf9be3
refactor(docker): remove docker build and deploy workflows
bunbry Jan 8, 2025
bbcc093
fix(debian build): move working-directory from job to step
bunbry Jan 9, 2025
eb3ba1c
feat(debian deploy)!: determine deployed package from inputs
bunbry Jan 9, 2025
402cfbe
feat(debian build): package version as workflow output
bunbry Jan 9, 2025
44ec782
refactor(debian build): always get package version from versions file
bunbry Jan 9, 2025
b67916d
fix(debian deploy): remove "needs" section from deploy job
bunbry Jan 14, 2025
2d64f08
docs(debian): fix some spelling errors and rephrase description of wo…
bunbry Jan 15, 2025
49fecc1
updated readme
akomii Jan 21, 2025
b4dca94
feat(debian build): fail if artifact contains no files
bunbry Jan 15, 2025
0711fcc
refactor: remove unused workflow versions for deployment of debian files
bunbry Jan 21, 2025
842d22e
refactor: remove unused action "get-newest-artifact"
bunbry Jan 21, 2025
eb15457
fix(debian build): use checkout action as first step / before version…
bunbry Jan 21, 2025
c7d8aa0
feat(debian build): ensure that build.sh is executable
bunbry Jan 21, 2025
f8c9a3b
refactor(debian build): remove obsolete version generation step for n…
bunbry Jan 21, 2025
4b5cb33
docs(debian build): rephrase description for output "package-version"
bunbry Jan 21, 2025
5ea789f
refactor(debian deploy): downgrade default OS to Ubuntu 22.04
bunbry Jan 21, 2025
f059c1a
feat(debian deploy): hostname of apt repo server as secret
bunbry Jan 21, 2025
909c018
refactor(debian deploy): add path to repository as an input
bunbry Jan 22, 2025
c09303b
refactor(maven)!: change "install-r" workflow to input for generic ap…
bunbry Jan 22, 2025
fdf7b00
feat(maven): add workflow secret "AKTIN_MAVEN_REPOSITORY"
bunbry Jan 22, 2025
757b6c4
refactor(debian deploy): remove unused environment variable REPREPRO_…
bunbry Jan 23, 2025
a10154d
fix(debian deploy)!: preset and remove GPG passphrase in remote gpg-a…
bunbry Jan 23, 2025
fb3da6b
fix(debian deploy): add " around environment variable
bunbry Jan 23, 2025
43a6446
docs(debian deploy): rephrase step names
bunbry Jan 23, 2025
f5c4950
feat(debian deploy): list available packages after deployment
bunbry Jan 28, 2025
85a7326
docs(maven): java version description LTS only
bunbry Jan 28, 2025
539bb5d
feat(maven): suppress download progress during build and deploy
bunbry Jan 28, 2025
43b10e3
fix(debian build): add working directory to cache generation step
bunbry Jan 28, 2025
8d818da
style(debian build): use ${{env.VERSION}} not $VERSION
bunbry Jan 28, 2025
77be073
refactor(maven) remove commented out lines
bunbry Jan 28, 2025
41a090e
style: consistent use of free lines and empty last lines
bunbry Jan 28, 2025
61d3a4b
feat(debian deploy): add cleanup on remote
bunbry Jan 28, 2025
31e999e
fix(debian deploy): explicit path to package
bunbry Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/debian-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build Debian Package

on:
workflow_call:
inputs:
artifact-name:
description: 'Name of the artifact which contains the debian package'
default: 'debian-package'
type: string
package-name:
description: 'Name of the debian package'
required: true
type: string
outputs:
package-version:
description: 'Version of the built debian package'
value: ${{ jobs.debian-build.outputs.version }}

jobs:
debian-build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prep-version.outputs.version }}
steps:
- uses: actions/checkout@v4

- name: Prepare Version Variable
id: prep-version
run: |
STR=$(grep "PACKAGE_VERSION=" versions)
VERSION=${STR#PACKAGE_VERSION=}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
working-directory: src/resources

- name: Generate Cache Name
run: echo "CACHE=${sort versions | awk '!/(^[[:space:]]*$|PACKAGE_VERSION=|#)/' ORS='--'}" >> $GITHUB_ENV
working-directory: src/resources

- name: Retrieve Cached Downloads
uses: actions/cache@v4
with:
path: src/downloads/
key: downloads--${{ env.CACHE }}

- name: Build Debian
run: |
chmod +x build.sh
build.sh
working-directory: src/debian

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: src/debian/build/${{ inputs.package-name }}_${{ env.VERSION }}.deb
if-no-files-found: 'error'
72 changes: 72 additions & 0 deletions .github/workflows/debian-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: AKTIN Deploy Debian Package

on:
workflow_call:
inputs:
artifact-name:
description: 'Artifact name'
default: 'debian-package'
type: string
codename:
description: 'OS codename'
default: 'jammy'
type: string
package-name:
description: 'Name of the debian package'
required: true
type: string
package-version:
description: 'Version of the debian package'
required: true
type: string
repository-path:
description: 'Local directory containing conf, db, dists, and pool directories'
default: '/software/repo/org/apt'
type: string
secrets:
SSH_USER:
description: 'Username for the server hosting the AKTIN APT repository'
required: true
SSH_PRIVATE_KEY:
description: 'Private Key for authenticating with the server hosting the AKTIN APT repository'
required: true
SSH_REMOTE:
description: 'Hostname of the server hosting the AKTIN APT repository'
required: true
GPG_PASSPHRASE:
description: 'Passphrase for GPG private key used for signing the published debian packages'
required: true
GPG_KEYGRIP:
description: 'Keygrip identifier of the GPG private key'
required: true

jobs:
debian-deploy:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
PACKAGE: "${{ inputs.package-name }}_${{ inputs.package-version }}.deb"
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}

- name: Setup SSH Key
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Transfer Debian Package to Remote
run: scp "$PACKAGE" "${{ secrets.SSH_USER }}@${{ secrets.SSH_REMOTE }}:${{ inputs.repository-path }}/"

- name: Include Debian Package in APT Repository
run: > # use folded block style (>) because this is one long command
ssh "${{ secrets.SSH_USER }}@${{ secrets.SSH_REMOTE }}"
"
/usr/lib/gnupg/gpg-preset-passphrase -c -P '${{ secrets.GPG_PASSPHRASE }}' '${{ secrets.GPG_KEYGRIP }}';
reprepro -b '${{ inputs.repository-path }}' includedeb '${{ inputs.codename }}' '${{ inputs.repository-path }}/$PACKAGE';
reprepro -b '${{ inputs.repository-path }}' list '${{ inputs.codename }}'
rm '${{ inputs.repository-path }}/$PACKAGE'
gpg-connect-agent reloadagent /bye
"
83 changes: 83 additions & 0 deletions .github/workflows/maven-build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: AKTIN Build & Deploy Maven

on:
workflow_call:
inputs:
java-version:
description: 'Java LTS version'
required: true
type: number
java-distribution:
description: 'Java distribution'
default: 'temurin'
required: false
type: string
apt-dependencies:
description: 'Dependencies installed via apt (as space separated list)'
required: false
type: string
secrets:
AKTIN_MAVEN_USERNAME:
description: 'Maven repository username'
required: false
AKTIN_MAVEN_PASSPHRASE:
description: 'Maven repository passphrase'
required: false
AKTIN_MAVEN_GPG_PASSPHRASE:
description: 'Passphrase for the maven repositories GPG private key'
required: false
AKTIN_MAVEN_GPG_PRIVATE_KEY:
description: 'Content of the maven repositories GPG private key'
required: false
AKTIN_MAVEN_REPOSITORY:
description: 'Hostname of the server hosting the maven repository'
required: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Prepare Working Directory Variable
run: echo "WORK_DIR=${GITHUB_REPOSITORY#aktin/}" >> $GITHUB_ENV

- name: Checkout parent POM
uses: actions/checkout@v4
with:
repository: aktin/aktin

- name: Checkout project
uses: actions/checkout@v4
with:
path: ${{ env.WORK_DIR }}

- name: Set up JDK ${{ inputs.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.java-distribution }}
cache: maven
server-id: aktinupload.software.magdeburg # value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_PASSPHRASE # env variable for token/password in deploy
gpg-private-key: ${{ secrets.AKTIN_MAVEN_GPG_PRIVATE_KEY }} # value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Install APT Dependencies
if: inputs.apt-dependencies
run: sudo apt install -y ${{ inputs.apt-dependencies }}

- name: Build & (Unit-)Test
run: mvn -B package --no-transfer-progress
working-directory: ${{ env.WORK_DIR }}

- name: Deploy
if: startsWith(github.ref, 'refs/tags/v')
run: |
mvn versions:set -DnewVersion=${GITHUB_REF_NAME#v}
mvn deploy --no-transfer-progress
working-directory: ${{ env.WORK_DIR }}
env:
MAVEN_USERNAME: ${{ secrets.AKTIN_MAVEN_USERNAME }}
MAVEN_PASSPHRASE: ${{ secrets.AKTIN_MAVEN_PASSPHRASE }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.AKTIN_MAVEN_GPG_PASSPHRASE }}
MAVEN_REPOSITORY: ${{ secrets.AKTIN_MAVEN_REPOSITORY }}
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repository contains a collection of custom GitHub Actions and Github Workfl

### Actions:

- **python-ql**: Performs linting, code formatting, security scanning, and custom integration testing for Python projects.
- **python-ql**: Performs linting, code formatting, security scanning, and custom integration testing for Python projects

#### Usage:

Expand All @@ -27,15 +27,17 @@ jobs:
uses: actions/checkout@v2

- name: Run action1
uses: aktin/aktin-github-actions/action1@main
uses: aktin/aktin-github-scripts/action1@main
with:
parameter1: 'value1'
parameter2: 'value2 value3 value4'
```

### Workflows:

-
- **debian-build**: Builds a Debian package, runs integration tests, and uploads the `.deb` as a build artifact
- **debian-deploy**: Retrieves the `.deb` build artifact and adds it to a remote Debian repository using `reprepro`
- **maven-build-deploy**: Builds a Maven project, runs integration tests, and optionally deploys `.jar`/`.war`/`.ear` files to the AKTIN Maven repository

#### Usage:

Expand All @@ -51,7 +53,7 @@ on:

jobs:
call-reusable-workflow:
uses: aktin/aktin-github-actions/workflows/workflow1.yml@main
uses: aktin/aktin-github-scripts/.github/workflows/workflow1.yml@main
with:
input1: 'value1'
input2: 'value2'
Expand Down