Skip to content

Commit

Permalink
GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jplomas committed Jun 24, 2024
0 parents commit a24dd94
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

on:
push:
paths-ignore:
- '.vscode/**'
- '**.toml'
- '**.md'
pull_request:
paths-ignore:
- '.vscode/**'
- '**.toml'
- '**.md'
workflow_dispatch:

name: CI

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
push:
name: Push Docker image to container registry
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
29 changes: 29 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag'
required: true

name: Manual Push

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
push:
name: Push Docker image to container registry
runs-on: ubuntu-latest
steps:
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}
21 changes: 21 additions & 0 deletions .github/workflows/sign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on: workflow_dispatch

name: Generate Dilithium Signatures

jobs:
test:
name: Generate Checksum
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Generate checksum
uses: jplomas/actions-dilithium-sign@v1
with:
patterns: |
*.*
- name: Upload signature file as artifact
uses: actions/upload-artifact@master
with:
name: result
path: signatures.txt
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu:latest
RUN apt-get update && apt-get upgrade -y && apt-get install -y git golang-go

RUN git clone https://github.com/theQRL/qrlft.git
WORKDIR /qrlft
RUN go mod download
RUN go build
COPY . .

ENTRYPOINT ["/qrlft/entrypoint.sh"]

23 changes: 23 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Generate Dilithium Signatures'
description: Generates a signatures file from a list of glob patterns
inputs:
hexseed:
description: Hexseed to use
required: true
output:
description: Output file path
required: false
default: signatures.txt
patterns:
description: List of glob patterns to use for matching files
required: true
runs:
using: docker
image: docker://ghcr.io/jplomas/actions-dilithium-sign:v1.0.0
args:
- ${{ inputs.hexseed }}
- ${{ inputs.output }}
- ${{ inputs.patterns }}
branding:
icon: align-center
color: green
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -e
set -o pipefail

/qrlft/qrlft sign --hs $1 $3 > $2

0 comments on commit a24dd94

Please sign in to comment.