Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify automatic release drafting setup
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye committed Nov 15, 2021
1 parent 5d798e7 commit 101ce3a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 104 deletions.
74 changes: 33 additions & 41 deletions .github/workflows/build-action.yml
Expand Up @@ -23,7 +23,7 @@ on:
default: 'Build for testing purposes'

jobs:
build32:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -38,56 +38,48 @@ jobs:
sudo -E bash -c set
sudo apt-get update
sudo apt-get install --yes libarchive-zip-perl dos2unix systemd-container qemu-user-static qemu-utils
echo "::set-output name=image::$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_armhf_latest" -s -L -I -o /dev/null -w '%{url_effective}')")"
- name: Cache Raspberry Pi OS image
echo "::set-output name=image32::$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_armhf_latest" -s -L -I -o /dev/null -w '%{url_effective}')")"
echo "::set-output name=image64::$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_arm64_latest" -s -L -I -o /dev/null -w '%{url_effective}')")"
- name: Cache Raspberry Pi OS 32bit image
uses: actions/cache@v2.1.6
with:
path: ${{ steps.setup.outputs.image }}
key: ${{ steps.setup.outputs.image }}
- name: Build openHABian 32bit image
path: ${{ steps.setup.outputs.image32 }}
key: ${{ steps.setup.outputs.image32 }}
- name: Cache Raspberry Pi OS 64bit image
uses: actions/cache@v2.1.6
with:
path: ${{ steps.setup.outputs.image64 }}
key: ${{ steps.setup.outputs.image64 }}
- name: Build openHABian images
id: build
run: |
sudo -E ./tests/ci-setup.bash github .pi-raspios32
sudo -E ./tests/ci-setup.bash github ${{ github.ref_name }}
sed -i -e "s|^userpw=.*$|userpw=\"${{secrets.USERPW}}\"|g" build-image/openhabian.pi-raspios32.conf
sed -i -e "s|^userpw=.*$|userpw=\"${{secrets.USERPW}}\"|g" build-image/openhabian.pi-raspios64beta.conf
sed -i -e "s|ap_password:.*$|ap_password: ${{secrets.HOTSPOTPW}}|g" includes/comitup.conf
sudo -E ./build.bash rpi
echo "::set-output name=file::$(ls openhabian-*.img.xz)"
sudo -E ./build.bash rpi64
echo "::set-output name=image32::$(ls openhabian-pi-raspios32*.img.xz)"
echo "::set-output name=image64::$(ls openhabian-pi-raspios64beta*.img.xz)"
- name: Archive openHABian 32bit image
uses: actions/upload-artifact@v2
with:
name: ${{ steps.build.outputs.file }}
path: ${{ steps.build.outputs.file }}
build64experimental:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2.4.0
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup environment
id: setup
run: |
sudo -E bash -c set
sudo apt-get update
sudo apt-get install --yes libarchive-zip-perl dos2unix systemd-container qemu-user-static qemu-utils
echo "::set-output name=image::$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_arm64_latest" -s -L -I -o /dev/null -w '%{url_effective}')")"
- name: Cache Raspberry Pi OS image
uses: actions/cache@v2.1.6
with:
path: ${{ steps.setup.outputs.image }}
key: ${{ steps.setup.outputs.image }}
- name: Build openHABian 64bit image
id: build
run: |
sudo -E ./tests/ci-setup.bash github .pi-raspios64beta
sed -i -e "s|^userpw=.*$|userpw=\"${{secrets.USERPW}}\"|g" build-image/openhabian.pi-raspios64beta.conf
sed -i -e "s|ap_password:.*$|ap_password: ${{secrets.HOTSPOTPW}}|g" includes/comitup.conf
sudo -E ./build.bash rpi64
echo "::set-output name=file::$(ls openhabian-*.img.xz)"
name: ${{ steps.build.outputs.image32 }}
path: ${{ steps.build.outputs.image32 }}
- name: Archive openHABian 64bit image
uses: actions/upload-artifact@v2
with:
name: ${{ steps.build.outputs.file }}
path: ${{ steps.build.outputs.file }}
name: ${{ steps.build.outputs.image64 }}
path: ${{ steps.build.outputs.image64 }}
- name: Create release template
if: ${{ success() && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
uses: "marvinpinto/action-automatic-releases@v1.2.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
title: "openHABian ${{ github.ref_name }}"
automatic_release_tag: "${{ github.ref_name }}"
prerelease: false
draft: true
files: |
${{ steps.build.outputs.image32 }}
${{ steps.build.outputs.image64 }}
62 changes: 0 additions & 62 deletions .github/workflows/release-action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/ci-setup.bash
Expand Up @@ -18,7 +18,7 @@ if [[ $1 == "github" ]]; then
repoURL="$(git remote get-url origin)"
repoBranch="$(git rev-parse --abbrev-ref HEAD)"

if ! [[ $2 == "release" ]]; then
if ! git show-ref --tags "$2" --quiet; then
sed -i 's#debugmode=.*$#debugmode=on#' build-image/openhabian.conf
fi

Expand Down

0 comments on commit 101ce3a

Please sign in to comment.