Last active
November 22, 2023 05:47
Github Action Example (.github/workflows)
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
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