mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
320ffd8ab6
* Push packages on tag push * Use channel/X derived from tag name
70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
name: Package
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
branches:
|
|
- packaging/*
|
|
- release/*
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 3 * * *' # Daily at 03:00
|
|
|
|
jobs:
|
|
build:
|
|
if: github.repository == 'opf/openproject'
|
|
name: ${{ matrix.target }}
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
env:
|
|
POSTGRES_DB: app
|
|
POSTGRES_USER: app
|
|
POSTGRES_PASSWORD: p4ssw0rd
|
|
ports:
|
|
- 5432:5432
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- debian:11
|
|
- debian:12
|
|
- ubuntu:20.04
|
|
- ubuntu:22.04
|
|
- el:9
|
|
- sles:15
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup
|
|
id: setup
|
|
run: |
|
|
VERSION=$(ruby -r ./lib/open_project/version.rb -e "puts OpenProject::VERSION")
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
if [[ "${{ github.ref_type }}" == "tag" ]]; then
|
|
MAJOR=$(ruby -r ./lib/open_project/version.rb -e "puts OpenProject::VERSION::MAJOR")
|
|
echo "channel=stable/${MAJOR}" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "channel=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Package
|
|
uses: pkgr/action/package@main
|
|
id: package
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
version: ${{ steps.setup.outputs.version }}
|
|
debug: true
|
|
cache_prefix: ${{ github.ref_name }}
|
|
env: |
|
|
DATABASE_URL=postgres://app:p4ssw0rd@127.0.0.1:5432/app
|
|
- name: Publish
|
|
uses: pkgr/action/publish@main
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
token: ${{ secrets.PACKAGER_PUBLISH_TOKEN }}
|
|
repository: opf/openproject
|
|
channel: ${{ steps.setup.outputs.channel }}
|
|
file: ${{ steps.package.outputs.package_path }}
|