Skip to content

Commit fcb1247

Browse files
committed
ci: create release on tag
1 parent 1732efd commit fcb1247

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/publish-tag.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
permissions:
14-
contents: 'read'
14+
contents: 'write'
1515
id-token: 'write'
1616

1717
steps:
1818
- id: checkout
1919
name: Checkout
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2121

2222
- id: auth
2323
name: Authenticate with Google Cloud
24-
uses: google-github-actions/auth@v2
24+
uses: google-github-actions/auth@v3
2525
with:
2626
token_format: access_token
2727
workload_identity_provider: projects/51853309262/locations/global/workloadIdentityPools/my-pool/providers/my-provider
@@ -34,7 +34,7 @@ jobs:
3434
cat app/pyproject.toml
3535
3636
- name: Setup Python
37-
uses: actions/setup-python@v3
37+
uses: actions/setup-python@v6
3838

3939
- name: Install Dependencies
4040
run: |
@@ -60,3 +60,18 @@ jobs:
6060
gcloud config set artifacts/location europe-west1
6161
gcloud artifacts print-settings python > ~/.pypirc
6262
python -m twine upload --repository python dist/*
63+
64+
- name: Check if pre-release
65+
id: check_prerelease
66+
run: |
67+
if [[ "${{ github.ref_name }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$ ]]; then
68+
echo "prerelease=false" >> $GITHUB_OUTPUT
69+
else
70+
echo "prerelease=true" >> $GITHUB_OUTPUT
71+
fi
72+
73+
- name: Create GitHub Release
74+
uses: softprops/action-gh-release@v2
75+
with:
76+
generate_release_notes: true
77+
prerelease: ${{ steps.check_prerelease.outputs.prerelease }}

0 commit comments

Comments
 (0)