Skip to content

Commit

Permalink
Deb release automation (The-OpenROAD-Project#4473)
Browse files Browse the repository at this point in the history
* add release and asset steps
* use sync fork for PII

---------

Signed-off-by: habibayassin <[email protected]>
Signed-off-by: Vitor Bandeira <[email protected]>
Co-authored-by: Vitor Bandeira <[email protected]>
  • Loading branch information
habibayassin and vvbandeira authored Jan 25, 2024
1 parent f1340fb commit bc92882
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 2 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/github-actions-build-deb-package.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build deb packages

on:
workflow_dispatch:
push:
pull_request:
branches:
- master

jobs:
builder:
Expand Down Expand Up @@ -44,3 +44,40 @@ jobs:
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

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Automatically sync branch from upstream.

on:
schedule:
- cron: "0 14 * * *"

workflow_dispatch:
inputs:
force:
description: Use GitHub --force push.
default:

repository_dispatch:


jobs:
Sync-Branch-From-Upstream:
name: Automatic sync 'master' from The-OpenROAD-Project/OpenROAD
runs-on: ubuntu-latest

# Only allow one action to run at a time.
concurrency: sync-branch-from-upstream

# Action needs no permissions, as push is granted via adding a deploy key
# with write access to the $DEPLOY_KEY secret.
permissions:
contents: read

# Don't run on the upstream repository and only run on the right branch.
if: ${{ github.repository_owner == 'Precision-Innovations' && endsWith(github.ref, '/master') }}

steps:

- uses: The-OpenROAD-Project/actions/upstream_sync@main
env:
HAS_DEPLOY_KEY: ${{ !!(secrets.DEPLOY_KEY) }}
if: ${{ env.HAS_DEPLOY_KEY == 'true' }}
with:
upstreamRepo: The-OpenROAD-Project/OpenROAD
upstreamBranch: master
# To always overwrite master branch, set UPSTREAM_SYNC to the exact
# string 'always overwrite master branch'.
# You can also manually trigger a workflow dispatch with the force
# value equal to 'true'.
force: ${{ github.event.inputs.force || (secrets.UPSTREAM_SYNC == 'always overwrite master branch') }}
deployKey: ${{ secrets.DEPLOY_KEY }}

0 comments on commit bc92882

Please sign in to comment.