mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-08-18 13:44:55 +02:00
🔨 Publish dev realese
This commit is contained in:
parent
7af0263b6c
commit
916fc0c526
40
.github/workflows/build_addon.yml
vendored
40
.github/workflows/build_addon.yml
vendored
@ -13,7 +13,7 @@ env:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-armhf:
|
build-armhf:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
@ -24,13 +24,13 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Add Qemu-user-static
|
- name: Add Qemu-user-static ${{matrix.arch}}
|
||||||
run: docker run --rm --privileged hassioaddons/qemu-user-static:latest
|
run: docker run --rm --privileged hassioaddons/qemu-user-static:latest
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx ${{matrix.arch}}
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Set Version
|
- name: Set Version Prod ${{matrix.arch}}
|
||||||
if: github.event_name != 'workflow_dispatch' && github.event_name != 'push'
|
if: github.event_name != 'workflow_dispatch' && github.event_name != 'push'
|
||||||
run: |
|
run: |
|
||||||
version=${GITHUB_REF/refs\/tags\//}
|
version=${GITHUB_REF/refs\/tags\//}
|
||||||
@ -38,22 +38,33 @@ jobs:
|
|||||||
tmp=$(mktemp)
|
tmp=$(mktemp)
|
||||||
jq --arg version "$version" '.version=$version' ${{env.TARGET}}/config.json > "$tmp" && mv "$tmp" ${{env.TARGET}}/config.json
|
jq --arg version "$version" '.version=$version' ${{env.TARGET}}/config.json > "$tmp" && mv "$tmp" ${{env.TARGET}}/config.json
|
||||||
fi
|
fi
|
||||||
|
echo "version_type=prod" >> $GITHUB_ENV
|
||||||
|
- name: Set Version Test ${{matrix.arch}}
|
||||||
|
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
|
||||||
|
run: |
|
||||||
|
version=dev_${GITHUB_RUN_ID}
|
||||||
|
if [ -n "$version" ];then
|
||||||
|
tmp=$(mktemp)
|
||||||
|
jq --arg version "$version" '.version=$version' ${{env.TARGET}}/config.json > "$tmp" && mv "$tmp" ${{env.TARGET}}/config.json
|
||||||
|
fi
|
||||||
|
echo "version_type=dev" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|
||||||
- name: Get build option ${{matrix.arch}}
|
- name: Get build option ${{matrix.arch}}
|
||||||
run: |
|
run: |
|
||||||
echo ::set-env name=NAME::"$(jq --raw-output '.name // empty' "${{env.TARGET}}/config.json" | sed "s/'//g")"
|
echo "NAME=$(jq --raw-output '.name // empty' "${{env.TARGET}}/config.json" | sed "s/'//g")" >> $GITHUB_ENV
|
||||||
echo ::set-env name=DESCRIPTION::"$(jq --raw-output '.description // empty' "${{env.TARGET}}/config.json" | sed "s/'//g")"
|
echo "DESCRIPTION=$(jq --raw-output '.description // empty' "${{env.TARGET}}/config.json" | sed "s/'//g")" >> $GITHUB_ENV
|
||||||
echo ::set-env name=URL::"$(jq --raw-output '.url // empty' "${{env.TARGET}}/config.json")"
|
echo "URL=$(jq --raw-output '.url // empty' "${{env.TARGET}}/config.json")" >> $GITHUB_ENV
|
||||||
echo ::set-env name=VERSION::"$(jq --raw-output '.version' "${{env.TARGET}}/config.json")"
|
echo "VERSION=$(jq --raw-output '.version' "${{env.TARGET}}/config.json")" >> $GITHUB_ENV
|
||||||
echo ::set-env name=IMAGE::"$(echo "${{env.IMAGE}}" | sed -r "s/\{arch\}/${{matrix.arch}}/g")"
|
echo "IMAGE=$(echo "${{env.IMAGE}}" | sed -r "s/\{arch\}/${{matrix.arch}}/g")" >> $GITHUB_ENV
|
||||||
echo ::set-env name=BUILD_FROM::"homeassistant/${{matrix.arch}}-base:latest"
|
echo "BUILD_FROM=homeassistant/${{matrix.arch}}-base:latest" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set Tags ${{matrix.arch}}
|
- name: Set Tags ${{matrix.arch}}
|
||||||
run: |
|
run: |
|
||||||
if [ "${{env.VERSION}}" != "dev" ]; then
|
if [ "${{env.version_type}}" != "dev" ]; then
|
||||||
echo ::set-env name=TAGS::"${{env.REPOSITORY}}/${{env.IMAGE}}:latest, ${{env.REPOSITORY}}/${{env.IMAGE}}:$(jq --raw-output '.version' "${{env.TARGET}}/config.json")"
|
echo "TAGS=${{env.REPOSITORY}}/${{env.IMAGE}}:latest, ${{env.REPOSITORY}}/${{env.IMAGE}}:$(jq --raw-output '.version' "${{env.TARGET}}/config.json")"
|
||||||
else
|
else
|
||||||
echo ::set-env name=TAGS::"${{env.REPOSITORY}}/${{env.IMAGE}}:$(jq --raw-output '.version' "${{env.TARGET}}/config.json")"
|
echo "TAGS=${{env.REPOSITORY}}/${{env.IMAGE}}:dev, $(jq --raw-output '.version' "${{env.TARGET}}/config.json")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Debug Env
|
- name: Debug Env
|
||||||
@ -77,6 +88,3 @@ jobs:
|
|||||||
labels: io.hass.name=${{env.NAME}}, io.hass.description=${{env.DESCRIPTION}}, io.hass.url=${{env.URL}}, io.hass.arch=${{matrix.arch}}, io.hass.version=${{env.VERSION}}, io.hass.type=addon
|
labels: io.hass.name=${{env.NAME}}, io.hass.description=${{env.DESCRIPTION}}, io.hass.url=${{env.URL}}, io.hass.arch=${{matrix.arch}}, io.hass.version=${{env.VERSION}}, io.hass.type=addon
|
||||||
build-args: BUILD_FROM=${{env.BUILD_FROM}}, BUILD_VERSION=${{env.VERSION}}
|
build-args: BUILD_FROM=${{env.BUILD_FROM}}, BUILD_VERSION=${{env.VERSION}}
|
||||||
file: ./${{env.TARGET}}/Dockerfile
|
file: ./${{env.TARGET}}/Dockerfile
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user