build(deps): bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #146
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Test | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:10-alpine | |
env: | |
POSTGRES_DB: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
rabbitmq: | |
image: rabbitmq:3-management-alpine | |
ports: | |
# AMQP | |
- 5672:5672 | |
# Management | |
- 15672:15672 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# Work around https://github.com/actions/checkout/issues/290 | |
- run: git fetch --force --tags | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
nimrod/build/agents | |
key: gradle-cache | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- run: | | |
psql <<EOF | |
CREATE ROLE nimrod LOGIN PASSWORD 'nimrod'; | |
CREATE DATABASE nimrod OWNER nimrod; | |
CREATE ROLE nimrod_portal WITH PASSWORD 'nimrod_portal' NOSUPERUSER INHERIT CREATEROLE CREATEDB LOGIN; | |
CREATE DATABASE nimrod_portal OWNER nimrod_portal; | |
EOF | |
env: | |
PGHOST: 127.0.0.1 | |
PGPORT: 5432 | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
- run: chmod +x gradlew | |
- run: ./gradlew --info assemble | |
- run: ./gradlew --info test | |
env: | |
NIMRODG_TEST_PGUSER: nimrod | |
NIMRODG_TEST_PGPASSWORD: nimrod | |
NIMRODG_TEST_PGHOST: 127.0.0.1 | |
NIMRODG_TEST_PGDATABASE: nimrod | |
- run: ./gradlew --info generateArtifacts | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: release-artifacts | |
path: '*/build/distributions/*' | |
deploy: | |
needs: build | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: release-artifacts | |
path: dist | |
- name: Sign packages | |
run: | | |
sudo apt-get -y install dpkg-sig rpm | |
printf '%s' "$RCC_PACKAGE_SIGNING_KEY" | gpg --import --batch | |
find dist -type f -name '*.deb' -print0 | \ | |
xargs -0r dpkg-sig -k $RCC_PACKAGE_SIGNING_KEY_ID -s builder | |
find dist -type f -name '*.rpm' -print0 | \ | |
xargs -0r rpmsign --key-id=$RCC_PACKAGE_SIGNING_KEY_ID --addsign | |
env: | |
RCC_PACKAGE_SIGNING_KEY: ${{ secrets.RCC_PACKAGE_SIGNING_KEY }} | |
RCC_PACKAGE_SIGNING_KEY_ID: ${{ secrets.RCC_PACKAGE_SIGNING_KEY_ID }} | |
# - name: Push packages to packages.rcc.uq.edu.au | |
# run: | | |
# mkdir -p ~/.ssh && chmod 0700 ~/.ssh | |
# printf '%s' "$RCC_PACKAGE_KNOWN_HOSTS" > ~/.ssh/known_hosts | |
# printf '%s' "$RCC_PACKAGE_SSH_KEY" > deploy | |
# chmod 0600 deploy | |
# sftp -i deploy [email protected] <<EOF | |
# put dist/nimrod/build/distributions/*.deb /ubuntu/pool/main/nimrod | |
# put dist/nimrod/build/distributions/*.rpm /centos7 | |
# put dist/nimrod-portal-backend/build/distributions/*.deb /ubuntu/pool/main/nimrod-portal-backend | |
# EOF | |
# env: | |
# RCC_PACKAGE_SSH_KEY: ${{ secrets.RCC_PACKAGE_SSH_KEY }} | |
# RCC_PACKAGE_KNOWN_HOSTS: ${{ secrets.RCC_PACKAGE_KNOWN_HOSTS }} | |
- uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: dist/*/build/distributions/* |