Skip to content

Commit 9e01b44

Browse files
committed
Tag and release together
1 parent a5eef98 commit 9e01b44

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

.github/workflows/publish.yml

+25-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
name: Release Cross-build environment
22

33
on:
4-
push:
5-
tags:
6-
- '*'
4+
schedule:
5+
# Run at 00:00 UTC on the 1st, 10th, and 20th of every month
6+
- cron: '0 0 1,10,20 * *'
7+
workflow_dispatch:
8+
inputs:
9+
release_version:
10+
description: 'The version to release'
11+
required: true
712

813
concurrency:
914
group: release-${{ github.workflow }}-${{ github.ref }}
@@ -17,8 +22,7 @@ jobs:
1722
runs-on: ubuntu-latest
1823
needs: [build]
1924
if: >-
20-
github.repository == 'pyodide/pyodide-build-environment-nightly' &&
21-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
25+
github.repository == 'pyodide/pyodide-build-environment-nightly'
2226
permissions:
2327
# Required to sign the attestations
2428
id-token: write
@@ -42,7 +46,11 @@ jobs:
4246
id: release_version
4347
shell: bash
4448
run: |
45-
echo "release_version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
49+
if [[ ${{ github.event_name }} == 'schedule' ]]; then
50+
echo "release_version=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
51+
else
52+
echo "release_version=${{ github.event.inputs.release_version }}" >> $GITHUB_OUTPUT
53+
fi
4654
4755
cat $GITHUB_OUTPUT
4856
@@ -52,11 +60,22 @@ jobs:
5260
shell: bash
5361
run: |
5462
gh attestation verify dist/xbuildenv.tar.bz2 --repo ${{ github.repository }}
63+
64+
- name: Create and push tag
65+
run: |
66+
git config --global user.name "Pyodide CI"
67+
git config --global user.email "[email protected]"
68+
TAG_NAME=${{ steps.release_version.outputs.release_version }}
69+
git tag $TAG_NAME
70+
git push origin $TAG_NAME
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5573

5674
- name: Create GitHub release with these wheels
5775
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
5876
with:
5977
files: |
6078
dist/*.tar.bz2
79+
tag_name: ${{ steps.release_version.outputs.release_version }}
6180
fail_on_unmatched_files: true
6281
name: ${{ steps.release_version.outputs.release_version }}

0 commit comments

Comments
 (0)