Skip to content

Commit

Permalink
ci: add release on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
romain pelletant committed Aug 3, 2022
1 parent 97b512b commit 1071322
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 39 deletions.
31 changes: 0 additions & 31 deletions .github/workflow/publish.yaml

This file was deleted.

21 changes: 17 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
token: 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

- name: Pull & update submodules recursively
run: |
Expand All @@ -24,8 +24,21 @@ jobs:
run: |
docker build -t ameba_rtl8720dn .
- name: Build checkin application
- name: Build firmware
run: |
docker run --rm \
-v $GITHUB_WORKSPACE:/workdir \
ameba_rtl8720dn \
/bin/bash -c ' cd /workdir/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp && make all'
/bin/bash -c 'chmod -R 777 /workdir/ambd_sdk/project && \
cd /workdir/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp && make all && \
cd /workdir/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp && make all '
- name: Upload firmware files
uses: actions/upload-artifact@v3
with:
name: FW-binaries
path: |
/home/runner/work/RTL8720DN_AT/RTL8720DN_AT/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/image/km4_image2_all.bin
/home/runner/work/RTL8720DN_AT/RTL8720DN_AT/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/image/km4_boot_all.bin
/home/runner/work/RTL8720DN_AT/RTL8720DN_AT/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/image/km0_boot_all.bin
/home/runner/work/RTL8720DN_AT/RTL8720DN_AT/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/image/km0_image2_all.bin
95 changes: 95 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
tags:
- '*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Pull & update submodules recursively
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Build image
run: |
docker build -t ameba_rtl8720dn .
- name: Build firmware
run: |
docker run --rm \
-v $GITHUB_WORKSPACE:/workdir \
ameba_rtl8720dn \
/bin/bash -c 'chmod -R 777 /workdir/ambd_sdk/project && \
cd /workdir/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp && make all && \
cd /workdir/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp && make all '
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: release_${{ github.ref }}
tag_name: ${{ github.ref }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload FW binaries KM4 app
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/RTL8720DN_AT/RTL8720DN_AT/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/image/km4_image2_all.bin
asset_name: km4_image2_all.bin
asset_content_type: application/octet-stream

- name: Upload FW binaries KM4 bootloader
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/RTL8720DN_AT/RTL8720DN_AT/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/image/km4_boot_all.bin
asset_name: km4_boot_all.bin
asset_content_type: application/octet-stream

- name: Upload FW binaries KM0 app
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/RTL8720DN_AT/RTL8720DN_AT/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/image/km0_image2_all.bin
asset_name: km0_image2_all.bin
asset_content_type: application/octet-stream

- name: Upload FW binaries KM0 bootloader
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/RTL8720DN_AT/RTL8720DN_AT/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/image/km0_boot_all.bin
asset_name: km0_boot_all.bin
asset_content_type: application/octet-stream

23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.1] - Unreleased yet

### TODO

- Test on board

## [1.0.0] - 2022-08-03

### Added

- [RTL8720DN_AT](https://github.com/RomainPelletant/RTL8720DN_AT)
Initial commit with AmebaD SDK and CI

### Changed

### Fixed

13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Building RTL8720DN binary to use it as Wifi SoC AT commands
![Build artifacts](https://github.com/Artifeel/checkin_fw/workflows/Build%20artifacts/badge.svg?branch=master)
# Building RTL8720DN binaries to use it as Wifi SoC AT commands
![Build artifacts](https://github.com/RomainPelletant/RTL8720DN_AT/workflows/Build%20artifacts/badge.svg?branch=master)
![Build release](https://github.com/RomainPelletant/RTL8720DN_AT/workflows/CI/badge.svg?tag=lastest)


## Build docker image toolchain

docker build -t ameba_rtl8720dn .
docker build -t ameba_rtl8720dn .

## Compile firmware

docker run -rm -v ${%PWD%}:/workdir ameba_rtl8720dn bash -c "cd /workdir/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp && make all"
docker run -rm -v ${%PWD%}:/workdir ameba_rtl8720dn bash -c "cd /workdir/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp && make all && cd /workdir/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp && make all"

## Build & artifacts CI

Find generated binaries as artifacts in Actions tab (in Github) and click on a successfull job : download artifact

0 comments on commit 1071322

Please sign in to comment.