diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df10345..e69c36d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,9 +9,6 @@ env: on: workflow_dispatch: - push: - tags: - - '*' jobs: build: @@ -19,7 +16,7 @@ jobs: runs-on: ubuntu-latest permissions: - contents: read + contents: read strategy: matrix: config: @@ -235,6 +232,11 @@ jobs: permissions: contents: write steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Download artifact uses: actions/download-artifact@v4 with: @@ -242,9 +244,21 @@ jobs: path: ${{ env.DIST_DIR }} merge-multiple: true + - name: Create a tag for the release + env: + TAG: ${{ env.REPO_REF }}-${{ github.run_number }} + run: | + git config --global user.email "arduinobot@arduino.cc" + git config --global user.name "ArduinoBot" + git tag ${{ env.TAG }} -m "${{ env.TAG }}" + git push origin ${{ env.TAG }} + - name: Create Github Release and upload artifacts uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} draft: false + prerelease: true artifacts: "${{ env.DIST_DIR }}/*" + tag: ${{ env.REPO_REF }}-${{ github.run_number }} +