Skip to content

Bump version of gateway-addon and gateway to 1.2.0-alpha.1 #8

Bump version of gateway-addon and gateway to 1.2.0-alpha.1

Bump version of gateway-addon and gateway to 1.2.0-alpha.1 #8

Workflow file for this run

name: Build and push pre-release images
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: true
- name: Dump upload url to file
run: echo '${{ steps.create_release.outputs.upload_url }}' > upload_url
- name: Upload upload_url
uses: actions/upload-artifact@v1
with:
name: upload_url
path: upload_url
build-docker-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Build image
uses: ilteoood/docker_buildx@master
with:
publish: true
imageName: webthingsio/gateway
platform: linux/amd64,linux/arm/v7,linux/arm64
tag: ${{ env.RELEASE_VERSION }}
dockerUser: ${{ secrets.DOCKER_HUB_USER }}
dockerPassword: ${{ secrets.DOCKER_HUB_PASSWORD }}
build-raspbian-image:
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install qemu
run: |
sudo apt update
sudo apt install -y qemu qemu-user-static binfmt-support kpartx --no-install-recommends
- name: Setup qemu-user-static
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build the image
run: |
cd image
./build.sh
- name: Download upload_url
uses: actions/download-artifact@v1
with:
name: upload_url
- name: Set upload_url
run: echo "UPLOAD_URL=$(cat upload_url/upload_url)" >> $GITHUB_ENV
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Upload image
id: upload-release-asset-image
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./image/gateway-${{ env.RELEASE_VERSION }}.img.zip
asset_name: gateway-${{ env.RELEASE_VERSION }}.img.zip
asset_content_type: application/zip
- name: Upload image checksum
id: upload-release-asset-image-checksum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./image/gateway-${{ env.RELEASE_VERSION }}.img.zip.sha256sum
asset_name: gateway-${{ env.RELEASE_VERSION }}.img.zip.sha256sum
asset_content_type: text/plain
- name: Find OTA packages
run: |
cd image
echo "GATEWAY_TARBALL=$(ls gateway-*.tar.gz | head -n1)" >> $GITHUB_ENV
echo "MODULES_TARBALL=$(ls node_modules-*.tar.gz | head -n1)" >> $GITHUB_ENV
- name: Upload gateway package
id: upload-release-asset-gateway
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./image/${{ env.GATEWAY_TARBALL }}
asset_name: ${{ env.GATEWAY_TARBALL }}
asset_content_type: application/zip
- name: Upload node modules package
id: upload-release-asset-node-modules
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./image/${{ env.MODULES_TARBALL }}
asset_name: ${{ env.MODULES_TARBALL }}
asset_content_type: application/zip
# build-deb-packages:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# image:
# - "ubuntu:bionic"
# - "arm64v8/ubuntu:bionic"
# - "ubuntu:focal"
# - "arm64v8/ubuntu:focal"
# - "ubuntu:groovy"
# - "arm64v8/ubuntu:groovy"
# - "debian:buster"
# - "arm64v8/debian:buster"
# - "balenalib/raspberry-pi-debian:buster-20200405"
# include:
# - image: "ubuntu:bionic"
# name: "ubuntu-bionic"
# arch: "amd64"
# - image: "arm64v8/ubuntu:bionic"
# name: "ubuntu-bionic"
# arch: "arm64"
# - image: "ubuntu:focal"
# name: "ubuntu-focal"
# arch: "amd64"
# - image: "arm64v8/ubuntu:focal"
# name: "ubuntu-focal"
# arch: "arm64"
# - image: "ubuntu:groovy"
# name: "ubuntu-groovy"
# arch: "amd64"
# - image: "arm64v8/ubuntu:groovy"
# name: "ubuntu-groovy"
# arch: "arm64"
# - image: "debian:buster"
# name: "debian-buster"
# arch: "amd64"
# - image: "arm64v8/debian:buster"
# name: "debian-buster"
# arch: "arm64"
# - image: "balenalib/raspberry-pi-debian:buster-20200405"
# name: "raspbian-buster"
# arch: "armhf"
# steps:
# - name: Install qemu
# run: |
# sudo apt update
# sudo apt install -y qemu qemu-user-static binfmt-support --no-install-recommends
# - name: Setup qemu-user-static
# run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# - name: Checkout the repository
# uses: actions/checkout@v2
# - name: Generate the source tarball
# run: |
# cd deb
# ./generate-tarball.sh
# - name: Build the Package
# run: |
# cd deb
# docker pull ${{ matrix.image }}
# docker create --name build -it ${{ matrix.image }} /build/build.sh
# docker cp . build:/build
# docker start -a build
# docker cp -L build:/build/webthings-gateway.deb ./webthings-gateway-${{ matrix.name }}-${{ matrix.arch }}.deb
# docker rm build
# - name: Download upload_url
# uses: actions/download-artifact@v1
# with:
# name: upload_url
# - name: Set upload_url
# run: echo "UPLOAD_URL=$(cat upload_url/upload_url)" >> $GITHUB_ENV
# - name: Upload .deb package
# id: upload-release-asset-deb
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ env.UPLOAD_URL }}
# asset_path: deb/webthings-gateway-${{ matrix.name }}-${{ matrix.arch }}.deb
# asset_name: webthings-gateway-${{ matrix.name }}-${{ matrix.arch }}.deb
# asset_content_type: application/zip
# build-rpm-packages:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# image:
# - "fedora:31"
# - "arm64v8/fedora:31"
# - "fedora:32"
# - "arm64v8/fedora:32"
# - "fedora:33"
# - "arm64v8/fedora:33"
# include:
# - image: "fedora:31"
# name: "fedora-31"
# arch: "x86_64"
# - image: "arm64v8/fedora:31"
# name: "fedora-31"
# arch: "aarch64"
# - image: "fedora:32"
# name: "fedora-32"
# arch: "x86_64"
# - image: "arm64v8/fedora:32"
# name: "fedora-32"
# arch: "aarch64"
# - image: "fedora:33"
# name: "fedora-33"
# arch: "x86_64"
# - image: "arm64v8/fedora:33"
# name: "fedora-33"
# arch: "aarch64"
# steps:
# - name: Install qemu
# run: |
# sudo apt update
# sudo apt install -y qemu qemu-user-static binfmt-support --no-install-recommends
# - name: Setup qemu-user-static
# run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# - name: Checkout the repository
# uses: actions/checkout@v2
# - name: Generate the source tarball
# run: |
# cd rpm
# ./generate-tarball.sh
# - name: Build the Package
# run: |
# cd rpm
# docker pull ${{ matrix.image }}
# docker create --name build -it ${{ matrix.image }} /build/build.sh
# docker cp . build:/build
# docker start -a build
# docker cp -L build:/build/webthings-gateway.rpm ./webthings-gateway-${{ matrix.name }}-${{ matrix.arch }}.rpm
# docker rm build
# - name: Download upload_url
# uses: actions/download-artifact@v1
# with:
# name: upload_url
# - name: Set upload_url
# run: echo "UPLOAD_URL=$(cat upload_url/upload_url)" >> $GITHUB_ENV
# - name: Upload .rpm package
# id: upload-release-asset-rpm
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ env.UPLOAD_URL }}
# asset_path: rpm/webthings-gateway-${{ matrix.name }}-${{ matrix.arch }}.rpm
# asset_name: webthings-gateway-${{ matrix.name }}-${{ matrix.arch }}.rpm
# asset_content_type: application/zip