From 8c26ecb027875fa75b3d5bc748db36691719fdf9 Mon Sep 17 00:00:00 2001 From: BBsan Date: Sat, 12 Feb 2022 20:21:04 +0100 Subject: [PATCH 01/12] Create main.yml --- .github/workflows/main.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..cfa9902 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +# 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/**' + - uses: marvinpinto/action-automatic-releases@v1.2.1 + # uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 + with: + # GitHub secret token + repo_token: "${{ secrets.GITHUB_TOKEN }}" + # Release title (for automatic releases) + title: "" + # Assets to upload to the release + files: | + bitstreams/*.bit + if: steps.changes.outputs.bitstream == 'true' + From 904134db6504f80bcd2070cf433d55b7042e5e2e Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 10:20:52 +0100 Subject: [PATCH 02/12] Create get_bitstream_version.sh --- .github/get_bitstream_version.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/get_bitstream_version.sh diff --git a/.github/get_bitstream_version.sh b/.github/get_bitstream_version.sh new file mode 100644 index 0000000..f43a5b7 --- /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) +DIRTY_VERSION=$(dd if=$1 skip=$(($OFFSET+4)) bs=1 count=8 2>&- | strings) +echo ${DIRTY_VERSION%?} From 6dc52a5ec8ac523efc928370ad00be4199c081e6 Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:04:15 +0100 Subject: [PATCH 03/12] Update Workflow to read out name --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cfa9902..136fa03 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,13 +31,16 @@ jobs: filters: | bitstream: - 'bitstream/**' + - name: get_bitstream_version + run: .github/get_bitstream_version.sh bitstreams/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 }}" # Release title (for automatic releases) - title: "" + title: "${{ BITSTREAM_VERSION }}" # Assets to upload to the release files: | bitstreams/*.bit From b8e07866913b22720c90a5638d61f86514d82343 Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:06:09 +0100 Subject: [PATCH 04/12] Write ENV Variable with Version --- .github/get_bitstream_version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/get_bitstream_version.sh b/.github/get_bitstream_version.sh index f43a5b7..fe4b31b 100644 --- a/.github/get_bitstream_version.sh +++ b/.github/get_bitstream_version.sh @@ -1,5 +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) -DIRTY_VERSION=$(dd if=$1 skip=$(($OFFSET+4)) bs=1 count=8 2>&- | strings) -echo ${DIRTY_VERSION%?} +VERSION=$(dd if=$1 skip=$(($OFFSET+4)) bs=1 count=4 2>&- | strings) +echo "${VERSION}" >> $BITSTREAM_VERSION From 900d5f091a2f3a3d085b3366d421b27f76afb07f Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:07:21 +0100 Subject: [PATCH 05/12] Fix? --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 136fa03..a4d29a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: # GitHub secret token repo_token: "${{ secrets.GITHUB_TOKEN }}" # Release title (for automatic releases) - title: "${{ BITSTREAM_VERSION }}" + title: ${{ env.BITSTREAM_VERSION }} # Assets to upload to the release files: | bitstreams/*.bit From ca1bd70371374948886a36ec4a7979637b3d292a Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:09:30 +0100 Subject: [PATCH 06/12] Fix permissions --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4d29a1..bf6b823 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: bitstream: - 'bitstream/**' - name: get_bitstream_version - run: .github/get_bitstream_version.sh bitstreams/default_720p.bit + run: chmod +x .github/get_bitstream_version.sh && .github/get_bitstream_version.sh bitstreams/default_720p.bit shell: bash - uses: marvinpinto/action-automatic-releases@v1.2.1 # uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 From 1a30420d2ded9daecafd0e81a37f4679dc401e5d Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:11:12 +0100 Subject: [PATCH 07/12] Fix Path of bitstream --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf6b823..1749704 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: bitstream: - 'bitstream/**' - name: get_bitstream_version - run: chmod +x .github/get_bitstream_version.sh && .github/get_bitstream_version.sh bitstreams/default_720p.bit + 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 From 2670c15ed9e187b507f05958d44501c5bb04f09e Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:12:57 +0100 Subject: [PATCH 08/12] Fix setting env variable --- .github/get_bitstream_version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/get_bitstream_version.sh b/.github/get_bitstream_version.sh index fe4b31b..ca74780 100644 --- a/.github/get_bitstream_version.sh +++ b/.github/get_bitstream_version.sh @@ -2,4 +2,4 @@ # 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 "${VERSION}" >> $BITSTREAM_VERSION +echo "BITSTREAM_VERSION=${VERSION}" >> $GITHUB_ENV From 50aa0ae30451bcd26d00f7a7e99460ba3d5fef5a Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:14:20 +0100 Subject: [PATCH 09/12] Test - release on every commit --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1749704..93f2940 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,5 +44,5 @@ jobs: # Assets to upload to the release files: | bitstreams/*.bit - if: steps.changes.outputs.bitstream == 'true' + #if: steps.changes.outputs.bitstream == 'true' From 2b28f28ae35b7202ef02e5401abf54c2ef8c5927 Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:16:05 +0100 Subject: [PATCH 10/12] Add Release Tag --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93f2940..cb01a84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,6 +39,7 @@ jobs: with: # GitHub secret token repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: latest # Release title (for automatic releases) title: ${{ env.BITSTREAM_VERSION }} # Assets to upload to the release From abeffaf6abcf5b82276c549844a29164ecd6b1e0 Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:22:03 +0100 Subject: [PATCH 11/12] Do real release, fix Location --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cb01a84..fb36509 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,8 +42,9 @@ jobs: automatic_release_tag: latest # Release title (for automatic releases) title: ${{ env.BITSTREAM_VERSION }} + prerelease: false # Assets to upload to the release files: | - bitstreams/*.bit + bitstream/*.bit #if: steps.changes.outputs.bitstream == 'true' From 0c1c08f5ac067330781c080d6350e51fa7036e36 Mon Sep 17 00:00:00 2001 From: BBsan Date: Sun, 13 Feb 2022 13:23:31 +0100 Subject: [PATCH 12/12] Re-Enable Release on Change --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb36509..3f49bfd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,5 +46,5 @@ jobs: # Assets to upload to the release files: | bitstream/*.bit - #if: steps.changes.outputs.bitstream == 'true' + if: steps.changes.outputs.bitstream == 'true'