From 0fbb5c7a9c8fb2ada9c331137fa3a4e2dd482081 Mon Sep 17 00:00:00 2001 From: enriquezgarc Date: Wed, 16 Aug 2023 17:24:22 +0200 Subject: [PATCH] .github: Refactored release pipeline. --- .github/scripts/release.py | 2 +- .github/workflows/release.yml | 33 ++++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/scripts/release.py b/.github/scripts/release.py index 0ee4ce79..6c4f5d87 100755 --- a/.github/scripts/release.py +++ b/.github/scripts/release.py @@ -53,7 +53,7 @@ def get_package_sha256(pkg): return hashlib.sha256(pkg.encode('UTF-8')).hexdigest() def get_latest_package_index_json(): - return requests.get('https://github.com/Infineon/XMC-for-Arduino/releases/latest/download/package_infineon_index.json').json() + return requests.get('https://github.com/Infineon/XMC-for-Arduino/releases/latest/download/package_infineon_index.json').json() def get_platform_data_struct_copy(pkg_index): return copy.deepcopy(pkg_index['packages'][0]['platforms'][0]) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 365b75ff..b5a60c5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,20 +3,35 @@ name: XMC-for-Arduino Release Automation on: release: types: published - + push: + tags: + - 'v*.*.*' + - 'V*.*.*' jobs: - build: - name: Publish Release + release: runs-on: ubuntu-latest - + if: startsWith(github.ref, 'refs/tags/V') steps: - - uses: actions/checkout@v2 - with: - ref: master + - uses: actions/checkout@v3 - uses: actions/setup-python@v1 with: python-version: '3.x' - - name: Build Release + - name: Build release changelog + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bash ./.github/scripts/on-release.sh \ No newline at end of file + - name: Build release assets + run: | + cd .github/scripts + echo "Tag name : ${{ github.ref_name }}" + python release.py build-release ${{ github.ref_name }} + + - name: Upload assets + uses: softprops/action-gh-release@v1 + with: + name: XMC for Arduino ${{ github.ref_name }} + files: | + pkg_build/*.zip + pkg_build/package_infineon_index.json + body: ${{steps.build_changelog.outputs.changelog}} \ No newline at end of file