From a0a5147c4241b5ac68625795d2b75fbd2c767725 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 11 Aug 2022 15:58:16 -0500 Subject: [PATCH] Update main_matrix.yml --- .github/workflows/main_matrix.yml | 33 ++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 246508531..8b663d533 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -405,19 +405,26 @@ jobs: release-artifacts: runs-on: ubuntu-latest - if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }} + if: ${{ github.event_name == 'workflow_dispatch' }} needs: [gather-artifacts] steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 with: - fetch-depth: 0 + python-version: 3.x + + - name: Get release version string + run: echo "::set-output name=version::$(./bin/buildinfo.py long)" + id: version - name: Get changed files id: changed-files uses: tj-actions/changed-files@v25 - uses: actions/download-artifact@v2 - if: contains(steps.changed-files.outputs.modified_files, 'version.properties') with: name: firmware-${{ steps.version.outputs.version }} path: ./output @@ -440,7 +447,6 @@ jobs: - name: Create release uses: actions/create-release@v1 id: create_release - if: contains(steps.changed-files.outputs.modified_files, 'version.properties') with: draft: true prerelease: true @@ -452,7 +458,6 @@ jobs: GITHUB_TOKEN: ${{ github.token }} - name: Add bins to release - if: contains(steps.changed-files.outputs.modified_files, 'version.properties') uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ github.token }} @@ -463,7 +468,6 @@ jobs: asset_content_type: application/zip - name: Add debug elfs to release - if: contains(steps.changed-files.outputs.modified_files, 'version.properties') uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ github.token }} @@ -472,3 +476,18 @@ jobs: asset_path: ./debug-elfs-${{ steps.version.outputs.version }}.zip asset_name: debug-elfs-${{ steps.version.outputs.version }}.zip asset_content_type: application/zip + + - name: Bump version + run: >- + bin/bump_version.py + + - name: Commit updated version.py + id: commit_updated + run: | + git config --global user.name 'github-actions' + git config --global user.email 'bot@noreply.github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + git add setup.py + git commit -m "bump version" && git push || echo "No changes to commit" + git log -n 1 --pretty=format:"%H" | tail -n 1 | awk '{print "::set-output name=sha::"$0}' +