Skip to content

Commit

Permalink
Tag and release together (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanking13 authored Mar 7, 2025
1 parent a5eef98 commit cc26a7b
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Release Cross-build environment

on:
push:
tags:
- '*'
schedule:
# Run at 00:00 UTC on the 1st, 10th, and 20th of every month
- cron: '0 0 1,10,20 * *'
workflow_dispatch:
inputs:
release_version:
description: 'The version to release'
required: true

concurrency:
group: release-${{ github.workflow }}-${{ github.ref }}
Expand All @@ -17,8 +22,7 @@ jobs:
runs-on: ubuntu-latest
needs: [build]
if: >-
github.repository == 'pyodide/pyodide-build-environment-nightly' &&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
github.repository == 'pyodide/pyodide-build-environment-nightly'
permissions:
# Required to sign the attestations
id-token: write
Expand All @@ -42,7 +46,11 @@ jobs:
id: release_version
shell: bash
run: |
echo "release_version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
if [[ ${{ github.event_name }} == 'schedule' ]]; then
echo "release_version=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
else
echo "release_version=${{ github.event.inputs.release_version }}" >> $GITHUB_OUTPUT
fi
cat $GITHUB_OUTPUT
Expand All @@ -52,11 +60,22 @@ jobs:
shell: bash
run: |
gh attestation verify dist/xbuildenv.tar.bz2 --repo ${{ github.repository }}
- name: Create and push tag
run: |
git config --global user.name "Pyodide CI"
git config --global user.email "[email protected]"
TAG_NAME=${{ steps.release_version.outputs.release_version }}
git tag $TAG_NAME
git push origin $TAG_NAME
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

0 comments on commit cc26a7b

Please sign in to comment.