Matt ffffff/releaseautomation (#6)

* Add release automation

* Update to build release versions

* use github_ref
This commit is contained in:
Matt White
2021-01-08 16:16:17 +00:00
committed by GitHub
parent 4a757c32d9
commit ecac3ceefb
2 changed files with 73 additions and 1 deletions
+9 -1
View File
@@ -7,6 +7,8 @@ on:
paths:
- '**'
- '!**.md'
release:
types: [published]
env:
DOCKER_USERNAME: mattffffff
@@ -42,7 +44,7 @@ jobs:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Set PLATFORM variable
- name: Set PLATFORM & ARCH variables
run: |
case "${{ matrix.arch }}" in
"amd64" )
@@ -62,6 +64,12 @@ jobs:
echo "ARCH=arm" >> $GITHUB_ENV
;;
esac
- name: Update config.json if release
run: |
export RELEASE=$( $GITHUB_REF | sed s/v// )
jq ".version=\"$RELEASE\"" < /config.json > config_release.json
rm config.json && mv config_release.json config.json
if: ${{ github.event_name == 'release' }}
- name: Set environment variables from config.json
run: |
echo "ADDON_VERSION=$(jq -r .version < config.json)" >> $GITHUB_ENV