Skip to content

release

release #145

Workflow file for this run

# Copyright (c) 2022 The Orbit Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
name: release
on:
schedule:
- cron: '0 6 * * 4'
workflow_dispatch:
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-debian-package:
runs-on: ubuntu-22.04
timeout-minutes: 180
permissions:
contents: write
env:
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
CCACHE_COMPRESS: "true"
CCACHE_COMPRESSLEVEL: "6"
CCACHE_MAXSIZE: "400M"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
path: workspace
- name: Install dependencies
run: |
sudo apt-get update && \
sudo apt-get install --yes --no-install-recommends \
build-essential \
devscripts \
cmake \
ccache \
git \
equivs \
git-buildpackage \
fakeroot
- name: Install Debian build dependencies
working-directory: ./workspace
run: sudo mk-build-deps --install debian/control
- name: Save CCache timestamp
id: ccache_timestamp
run: echo "timestamp=$(date +%m-%d-%Y--%H:%M:%S)" >> $GITHUB_OUTPUT
- name: Setup CCache files
uses: actions/cache@v3
with:
path: .ccache
key: debian-ccache-${{ steps.ccache_timestamp.outputs.timestamp }}
restore-keys: |
debian-ccache-
ccache-
- run: ccache -p
- run: ccache -z
- name: Generate version string
id: generate-version-string
working-directory: ./workspace
run: echo "version_string=$(git describe --always --match "1.*")-1~jammy1" >> $GITHUB_OUTPUT
- name: Update changelog file
working-directory: ./workspace
env:
EMAIL: orbitprofiler-eng@google.com
run: gbp dch --since=$(git describe --always --match "nightly*" --abbrev=0) --new-version=${{ steps.generate-version-string.outputs.version_string }} --ignore-branch
- name: Build Debian package
working-directory: ./workspace
run: |
debuild --set-envvar=CMAKE_C_COMPILER_LAUNCHER=ccache \
--set-envvar=CMAKE_CXX_COMPILER_LAUNCHER=ccache \
--preserve-envvar=GITHUB_WORKSPACE \
--preserve-envvar=CCACHE_BASEDIR \
--preserve-envvar=CCACHE_DIR \
--preserve-envvar=CCACHE_COMPRESS \
--preserve-envvar=CCACHE_COMPRESSLEVEL \
--preserve-envvar=CCACHE_MAXSIZE \
-b
- name: CCache Stats
run: ccache -s
- run: ls -la .
- name: Generate tag name
id: generate-tag-name
run: echo "tag_name=nightly-$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v1
with:
name: 'Orbit ${{ steps.generate-version-string.outputs.version_string }}'
body: 'This is an automated nightly release of Orbit.'
tag_name: ${{ steps.generate-tag-name.outputs.tag_name }}
target_commitish: ${{ github.sha }}
prerelease: true
files: |
*.deb