Skip to content

Commit

Permalink
Merge pull request #21 from bbsan2k/master
Browse files Browse the repository at this point in the history
Add github Action to automatically release Bitstream updates
  • Loading branch information
zwenergy authored Feb 24, 2022
2 parents 2fcc327 + 0c1c08f commit bdd5c99
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/get_bitstream_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# echo ${$(gdd if=default_720p-2.bit skip=$(($( echo $(env LANG=LC_ALL ggrep -a -b -o -P "\x30\x01\xA0\x01" $1) | gcut -d: -f1)+4)) bs=1 count=8 2>&- | strings)%?}
OFFSET=$(env LANG=LC_ALL grep -a -b -o -P "\x30\x01\xA0\x01" $1 | cut -d: -f1)
VERSION=$(dd if=$1 skip=$(($OFFSET+4)) bs=1 count=4 2>&- | strings)
echo "BITSTREAM_VERSION=${VERSION}" >> $GITHUB_ENV
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a basic workflow to help you get started with Actions

name: Release Bitstreams

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
release:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
bitstream:
- 'bitstream/**'
- name: get_bitstream_version
run: chmod +x .github/get_bitstream_version.sh && .github/get_bitstream_version.sh bitstream/default_720p.bit
shell: bash
- uses: marvinpinto/[email protected]
# uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0
with:
# GitHub secret token
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: latest
# Release title (for automatic releases)
title: ${{ env.BITSTREAM_VERSION }}
prerelease: false
# Assets to upload to the release
files: |
bitstream/*.bit
if: steps.changes.outputs.bitstream == 'true'

0 comments on commit bdd5c99

Please sign in to comment.