diff --git a/.github/get_bitstream_version.sh b/.github/get_bitstream_version.sh new file mode 100644 index 0000000..ca74780 --- /dev/null +++ b/.github/get_bitstream_version.sh @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3f49bfd --- /dev/null +++ b/.github/workflows/main.yml @@ -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/action-automatic-releases@v1.2.1 + # 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' +