Skip to content

Upload Release Asset #104

Upload Release Asset

Upload Release Asset #104

Workflow file for this run

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Any tag
name: Upload Release Asset
jobs:
# https://github.com/actions/upload-release-asset#example-workflow---upload-a-release-asset
build:
name: Upload Release Asset
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set vars stage 1
run: |
export TAG=$(echo ${{ github.ref }} | cut -d'/' -f3)
echo "release=$(echo $TAG | cut -d'_' -f1)" >> $GITHUB_ENV
echo "target=$(echo $TAG | cut -d'_' -f2)" >> $GITHUB_ENV
echo "subtarget=$(echo $TAG | cut -d'_' -f3)" >> $GITHUB_ENV
echo "build_profile=$(echo $TAG | cut -d'_' -f4,5,6,7,8,9,10)" >> $GITHUB_ENV
- name: Set vars stage 2
run: |
echo "target_dir=./builder-${{ env.release }}-${{ env.target }}-${{ env.subtarget }}/bin/targets/${{ env.target }}/${{ env.subtarget }}" >> $GITHUB_ENV
- name: Build project
run: |
make release="${{ env.release }}" target="${{ env.target }}" subtarget="${{ env.subtarget }}" build_profile="${{ env.build_profile }}"
ls ${{ env.target_dir }}/
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ env.target_dir }}/*