diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d18b194..fbea744 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,38 +93,9 @@ jobs: release: if: startsWith(github.ref, 'refs/tags/v') needs: [source-audit, build-examples, arduino-cli] - runs-on: ubuntu-latest permissions: contents: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Generate release changelog - run: | - python3 scripts/generate_release_changelog.py \ - --target-ref "${GITHUB_REF_NAME}" \ - --tag-name "${GITHUB_REF_NAME}" \ - --output "release-changelog.md" - - - name: Create GitHub Release - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ github.ref_name }} - target_commitish: ${{ github.sha }} - draft: false - prerelease: ${{ contains(github.ref_name, '-') }} - generate_release_notes: false - body_path: release-changelog.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ./.github/workflows/release.yml arduino-cli: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c98a2a1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + workflow_call: + +jobs: + create-release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Generate release changelog + run: | + python3 scripts/generate_release_changelog.py \ + --target-ref "${GITHUB_REF_NAME}" \ + --tag-name "${GITHUB_REF_NAME}" \ + --output "release-changelog.md" + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + target_commitish: ${{ github.sha }} + draft: false + prerelease: ${{ contains(github.ref_name, '-') }} + generate_release_notes: false + body_path: release-changelog.md + env: + GITHUB_TOKEN: ${{ github.token }}