Skip to content

Verify and Release

Verify and Release #19

Workflow file for this run

name: Verify and Release
on:
workflow_dispatch:
inputs:
release:
description: 'Version to release'
required: true
permissions: write-all
env:
javaVersion: java21
jobs:
release:
name: Release
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Set up JDK 21
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
distribution: 'temurin'
java-version: '21-ea'
cache: 'maven'
- name: Install buildtools
run: sudo apt-get install -y graphviz build-essential fakeroot devscripts debhelper dh-make bzr-builddeb wget
- name: Remove localtime
run: sudo rm /etc/localtime
- name: Set Swedish localtime
run: sudo ln -s /usr/share/zoneinfo/Europe/Stockholm /etc/localtime
- name: Update tzdata
run: sudo dpkg-reconfigure -f noninteractive tzdata
- name: Download Maven
run: wget https://archive.apache.org/dist/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz
- name: Unpack Maven
run: tar xzvf apache-maven-3.9.5-bin.tar.gz
- name: Set Maven
run: mv apache-maven-3.9.5 maven
- name: Set Version for release
run: maven/bin/mvn -B --file parent-pom/pom.xml versions:set -DnewVersion="${{ github.event.inputs.release }}" -Pall-modules versions:commit
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Automated Release ${{ github.event.inputs.release }}
branch: release-${{ github.event.inputs.release }}
tagging_message: '${{ github.event.inputs.release }}'
create_branch: true
- name: Build with Maven
run: maven/bin/mvn -B --file pom.xml clean install -Prelease-site,all-modules -DforkMode=once '-Dtest=!**ITest*,!**DocumentationTest*' -Dmaven.test.skip=true -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -Dsurefire.reportNameSuffix=UNIT
- name: Create a GitHub release
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
with:
tag: '${{ github.event.inputs.release }}'
generateReleaseNotes: true
name: Release ${{ github.event.inputs.release }}
artifacts: "cia-dist-deb/target/cia-dist-deb-${{ github.event.inputs.release }}.all.deb,cia-dist-deb/target/site/com.hack23.cia_cia-dist-deb-${{ github.event.inputs.release }}.spdx.json,cia-dist-cloudformation/target/dependency/cia-dist-cloudformation-${{ github.event.inputs.release }}.template,citizen-intelligence-agency/target/site/com.hack23.cia_citizen-intelligence-agency-${{ github.event.inputs.release }}.spdx.json"