Skip to content

Commit

Permalink
github: workflow: remove previous workflow with specific variables
Browse files Browse the repository at this point in the history
Using artifacts and release flow as other packages of the vicharak.

Signed-off-by: djkabutar <d.kabutarwala@yahoo.com>
  • Loading branch information
djkabutar committed Nov 19, 2024
1 parent b5a924b commit eb9477c
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 112 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/new_version.yml

This file was deleted.

133 changes: 58 additions & 75 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,65 @@
name: Build & Release
name: u-boot-menu

on:
workflow_dispatch:
pull_request:
push:

permissions:
contents: write
pull_request:

jobs:
build:
docker:
runs-on: ubuntu-latest
permissions: write-all

strategy:
matrix:
arch: [aarch64]

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Build
run: |
sudo apt-get update
sudo apt-get build-dep --no-install-recommends -y .
CC=aarch64-linux-gnu- dpkg-buildpackage -a arm64 -d -b -nc -uc
- name: Workaround actions/upload-artifact#176
run: |
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: |
${{ env.artifacts_path }}/*.deb
release:
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}
- name: Check if the latest version is releasable
- uses: actions/checkout@v2
name: Checkout code

- uses: uraimo/run-on-arch-action@v2
name: setup
with:
arch: aarch64
distro: ubuntu20.04
run: |
version="$(dpkg-parsechangelog -S Version)"
echo "version=$version" >> $GITHUB_ENV
echo "changes<<EOF" >> $GITHUB_ENV
echo '```' >> $GITHUB_ENV
echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV
echo '```' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
if [[ -n "$(git tag -l "$version")" ]]
then
echo "distro=UNRELEASED" >> $GITHUB_ENV
else
echo "distro=$(dpkg-parsechangelog -S Distribution)" >> $GITHUB_ENV
fi
echo "$version" > VERSION
- name: Release
if: env.distro != 'UNRELEASED'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.version }}
token: ${{ secrets.GITHUB_TOKEN }}
target_commitish: master
draft: false
fail_on_unmatched_files: false
files: |
*.deb
VERSION
- name: Append changelog
if: env.distro != 'UNRELEASED'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.version }}
body: |
## Changelog for ${{ env.version }}
${{ env.changes }}
append_body: true
apt-get update
apt install -y debhelper
./build-deb-package
echo "$(dpkg-parsechangelog -S Changes)" > DEBPKG.md
cp ../u-boot-menu_$(dpkg-parsechangelog -S Version)_all.deb ./

- name: check-Distribution
run: |
echo "distro=$(dpkg-parsechangelog -S Distribution)" >> $GITHUB_ENV
echo "version=$(dpkg-parsechangelog -S Version)" >> $GITHUB_ENV
- name: release
if: env.distro != 'UNRELEASED'
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: u-boot-menu-v${{ env.version }}
tag_name: v${{ env.version }}
body_path: DEBPKG.md
env:
GITHUB_TOKEN: ${{ github.token }}

- name: upload debian artifact
if: env.distro != 'UNRELEASED'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: u-boot-menu_${{ env.version }}_all.deb
asset_name: u-boot-menu_${{ env.version }}_all.deb
asset_content_type: application/octet-stream

- uses: actions/upload-artifact@v4
name: setup artifact
with:
name: debian-package
path: u-boot-menu_${{ env.version }}_all.deb
5 changes: 1 addition & 4 deletions build-deb-package
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#!/usr/bin/env bash

CC=aarch64-linux-gnu- dpkg-buildpackage -a arm64 -d -b -nc -uc -Zxz
dpkg-buildpackage -a arm64 -b -nc -uc -Zxz

if [ $? -eq 0 ]; then
echo "Build deb package success!"

# Copy deb package to current directory
mv ../u-boot-menu_* .
else
echo "Build deb package failed!"
fi

0 comments on commit eb9477c

Please sign in to comment.