Skip to content

Commit ee797d1

Browse files
committed
chore: publish tag with release (#8)
* chore: publish tag with release * add git checkout * fix release action config * change artifact download order
1 parent eb5e293 commit ee797d1

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ env:
99

1010
on:
1111
workflow_dispatch:
12-
push:
13-
tags:
14-
- '*'
1512

1613
jobs:
1714
build:
1815
name: build
1916
runs-on:
2017
ubuntu-latest
2118
permissions:
22-
contents: read
19+
contents: read
2320
strategy:
2421
matrix:
2522
config:
@@ -235,16 +232,33 @@ jobs:
235232
permissions:
236233
contents: write
237234
steps:
235+
- name: Checkout repository
236+
uses: actions/checkout@v4
237+
with:
238+
fetch-depth: 0
239+
238240
- name: Download artifact
239241
uses: actions/download-artifact@v4
240242
with:
241243
pattern: ${{ env.ARTIFACT_NAME }}*
242244
path: ${{ env.DIST_DIR }}
243245
merge-multiple: true
244246

247+
- name: Create a tag for the release
248+
env:
249+
TAG: ${{ env.REPO_REF }}-${{ github.run_number }}
250+
run: |
251+
git config user.name "Arduino Actions Bot"
252+
git config user.email "bot@arduino.cc"
253+
git tag ${{ env.TAG }} -m "${{ env.TAG }}"
254+
git push origin ${{ env.TAG }}
255+
245256
- name: Create Github Release and upload artifacts
246257
uses: ncipollo/release-action@v1
247258
with:
248259
token: ${{ secrets.GITHUB_TOKEN }}
249260
draft: false
261+
prerelease: true
250262
artifacts: "${{ env.DIST_DIR }}/*"
263+
tag: ${{ env.REPO_REF }}-${{ github.run_number }}
264+

0 commit comments

Comments
 (0)