Skip to content

Merge pull request #5791 from gadfort/tap-speedup #43

Merge pull request #5791 from gadfort/tap-speedup

Merge pull request #5791 from gadfort/tap-speedup #43

name: Build deb packages
on:
push:
branches:
- master
jobs:
builder:
name: 'Build .deb package'
strategy:
fail-fast: false
matrix:
os: ['debian10', 'debian11', 'ubuntu20.04', 'ubuntu22.04']
runs-on: ubuntu-latest
container:
image: openroad/${{ matrix.os }}-dev
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build package
run: |
mkdir artifacts
debuild --preserve-env --preserve-envvar=PATH -B
mv ../openroad_* artifacts
- name: Rename artifact
id: artifact
run: |
cd artifacts
file=$(realpath openroad_*.deb)
artifact=$(echo $file | sed 's/\.\([^.]*\)$/-${{ matrix.os }}.\1/')
mv $file $artifact
echo "file=$(realpath $artifact)" >> $GITHUB_OUTPUT
name=$(basename $artifact)
name=${name%.deb}
echo "name=$name" >> $GITHUB_OUTPUT
- name: Upload workflow artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact.outputs.name }}
path: ${{ steps.artifact.outputs.file }}
- name: Set release version
id: set_version
run: echo "RELEASE_VERSION=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Get release info
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
doNotFailIfNotFound: true
id: release_info
- name: Create release if not exists
if: steps.release_info.outputs.name == ''
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
body: "Release"
id: create_release
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_info.outputs.upload_url || steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.artifact.outputs.file }}
asset_name: ${{ steps.artifact.outputs.name }}-${{ env.RELEASE_VERSION }}.deb
asset_content_type: application/octet-stream