Skip to content

Instantly share code, notes, and snippets.

@JeonghunLee
Last active November 22, 2023 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeonghunLee/89ddda99f24ff8ad299bb8f41748ecb6 to your computer and use it in GitHub Desktop.
Save JeonghunLee/89ddda99f24ff8ad299bb8f41748ecb6 to your computer and use it in GitHub Desktop.
Github Action Example (.github/workflows)
name: myrelease-LoRa Gateway Build-Release (Push with Tag)
#
# Git push event trigger
#
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
# every push
# on: [push]
#
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v5.1.2
jobs:
build:
runs-on: ubuntu-latest
steps:
#
# Help
# - https://github.com/actions/checkout
#
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Lora Gateway
run: |
pwd
echo "Start to build Lora Gateway"
make all
mkdir -p output
cp -a libloragw/libloragw.a ./output/
cp -a util_pkt_logger/util_pkt_logger ./output/
cp -a util_spi_stress/util_spi_stress ./output/
cp -a util_tx_test/util_tx_test ./output/
cp -a util_lbt_test/util_lbt_test ./output/
cp -a util_tx_continuous/util_tx_continuous ./output/
cp -a util_spectral_scan/util_spectral_scan ./output/
zip --junk-paths -r loragateway output
#
# Help
# - https://github.com/actions/upload-artifact
#
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.0.0
with:
# Artifact name
name: LoRaLib
path: |
./output
retention-days: 90
#
# Help
# - https://github.com/actions/create-release
#
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
#
# Help
# - https://github.com/actions/upload-release-asset
#
- name: Add Release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./loragateway.zip
asset_name: loragateway.zip
asset_content_type: application/zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment