Merge pull request #521 from doudar/dependabot/github_actions/pre-com… #92
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: build | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Ensure changelog is updated | |
uses: dangoslen/[email protected] | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
architecture: 'x64' | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%y.%-m.%-d')" | |
- name: Test with environment variables | |
run: echo $TAG_NAME - $RELEASE_NAME | |
env: | |
TAG_NAME: ${{ steps.date.outputs.date }} | |
RELEASE_NAME: ${{ steps.date.outputs.date }}- | |
- uses: rickstaa/action-create-tag@v1 | |
with: | |
tag: ${{ steps.date.outputs.date }} | |
message: "Automatic release ${{ steps.date.outputs.date }}" | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
software: | |
- '!(Hardware/**)' | |
hardware: | |
- 'Hardware/**' | |
- name: Show python version | |
run: python --version | |
- name: Install PlatformIO | |
run: python -m pip install platformio | |
- name: Check pre-commit hooks | |
uses: pre-commit/[email protected] | |
- name: Build firmware | |
run: platformio run | |
- name: Build filesystem | |
run: platformio run --target buildfs | |
- name: Create artifacts | |
run: | | |
7z a SmartSpin2kFirmware-${{ steps.date.outputs.date }}.bin.zip ./.pio/build/release/*.bin | |
- name: Archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: all-artifacts | |
path: SmartSpin2kFirmware-${{ steps.date.outputs.date }}.bin.zip | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: all-artifacts | |
- name: Get tag info | |
id: tag_info | |
run: echo ::set-output name=SOURCE_TAG::${{ steps.date.outputs.date }} | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag_info.outputs.SOURCE_TAG }} | |
name: SmartSpin2k ${{ steps.tag_info.outputs.SOURCE_TAG }} | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
body: ${{ github.event.head_commit.message }} | |
files: | | |
SmartSpin2kFirmware-${{ steps.date.outputs.date }}.bin.zip | |
update-changelog: | |
- name: Update changelog | |
uses: thomaseizinger/keep-a-changelog-new-release@v1 | |
with: | |
version: ${{ steps.date.outputs.date }} | |