1
0
mirror of https://github.com/pumpitupdev/pumptools.git synced 2024-11-27 16:10:55 +01:00

Add github action workflows for building and publishing

Build every push to master and upload artifacts. For version tags,
do the same plus create a github release.
This commit is contained in:
icex2 2021-08-15 14:46:11 +02:00 committed by voidderef
parent 584795a7af
commit cdd7f15825
2 changed files with 112 additions and 0 deletions

40
.github/workflows/build-master.yaml vendored Normal file
View File

@ -0,0 +1,40 @@
# Regarding build steps, this is a copy of the Dockerfile and should be kept in-sync
name: "Build pumptools"
on:
push:
branches:
- master
jobs:
build:
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
# Building bootstrapped using docker containers
- name: "Install prerequisites"
run: |
sudo apt-get update
sudo apt-get install -y runc containerd docker.io
- name: "Build"
run: |
make build-docker
# Do some unpacking of the dist zip. Artifact upload repackages stuff
- name: "Prepare artifact package"
run: |
mkdir artifact
cd artifact
unzip ../build/docker/pumptools-public.zip
cd ..
- name: "Upload artifact"
uses: "actions/upload-artifact@v2"
with:
name: pumptools-${{ github.sha }}
retention-days: 30
if-no-files-found: "error"
path: |
artifact/**

72
.github/workflows/build-tag.yaml vendored Normal file
View File

@ -0,0 +1,72 @@
# Regarding build steps, this is a copy of the Dockerfile and should be kept in-sync
name: "Build pumptools"
on:
push:
tags:
- "*.*"
jobs:
build:
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
# Building bootstrapped using docker containers
- name: "Install prerequisites"
run: |
sudo apt-get update
sudo apt-get install -y runc containerd docker.io
- name: "Build"
run: |
make build-docker
# Do some unpacking of the dist zip. Artifact upload repackages stuff
- name: "Prepare artifact package"
run: |
mkdir artifact
cd artifact
unzip ../build/docker/pumptools-public.zip
cd ..
- name: "Upload artifact"
uses: "actions/upload-artifact@v2"
with:
name: pumptools-${{ github.sha }}
retention-days: 30
if-no-files-found: "error"
path: |
artifact/**
publish-release:
needs: "build"
runs-on: "ubuntu-20.04"
steps:
# This already extracts the contents of the artifact
- name: "Download artifact"
uses: "actions/download-artifact@v2"
with:
name: pumptools-${{ github.sha }}
- name: "Get the version"
id: get_version
run: |
echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
# The publish release action does not package the artifact *sigh*
- name: "Create release package"
run: |
zip pumptools-${{ steps.get_version.outputs.VERSION }}.zip *
- name: "Publish release"
uses: "marvinpinto/action-automatic-releases@v1.2.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
draft: false
prerelease: true
title: ${{ steps.get_version.outputs.VERSION }}
files: |
pumptools-${{ steps.get_version.outputs.VERSION }}.zip