-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: workflow: remove previous workflow with specific variables
Using artifacts and release flow as other packages of the vicharak. Signed-off-by: djkabutar <d.kabutarwala@yahoo.com>
- Loading branch information
Showing
3 changed files
with
59 additions
and
112 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |