-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/tagging-ios-package' into fix/ios-bindings-update-a…
…ction # Conflicts: # .github/workflows/update-ios-package.yml
- Loading branch information
Showing
2 changed files
with
29 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
name: Build and Publish EZKL iOS SPM package | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: "The tag to release" | ||
required: true | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
build-and-update: | ||
runs-on: macos-latest | ||
env: | ||
EZKL_SWIFT_PACKAGE_REPO: github.com/zkonduit/ezkl-swift-package.git | ||
EZKL_SWIFT_PACKAGE_REPO: github.com/ElusAegis/ezkl-swift-package.git | ||
|
||
steps: | ||
- name: Checkout EZKL | ||
uses: actions/checkout@v3 | ||
|
||
- name: Extract TAG from github.ref_name | ||
run: | | ||
# github.ref_name is provided by GitHub Actions and contains the tag name directly. | ||
TAG="${{ github.ref_name }}" | ||
echo "Original TAG: $TAG" | ||
# Remove leading 'v' if present | ||
NEW_TAG=${TAG#v} | ||
echo "Stripped TAG: $NEW_TAG" | ||
echo "TAG=$NEW_TAG" >> $GITHUB_ENV | ||
- name: Install Rust (nightly) | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
|
@@ -85,7 +94,7 @@ jobs: | |
cd ezkl-swift-package | ||
git config user.name "GitHub Action" | ||
git config user.email "[email protected]" | ||
git remote set-url origin https://zkonduit:${EZKL_SWIFT_PACKAGE_REPO_TOKEN}@${{ env.EZKL_SWIFT_PACKAGE_REPO }} | ||
git remote set-url origin https://ElusAegis:${EZKL_SWIFT_PACKAGE_REPO_TOKEN}@${{ env.EZKL_SWIFT_PACKAGE_REPO }} | ||
env: | ||
EZKL_SWIFT_PACKAGE_REPO_TOKEN: ${{ secrets.EZKL_PORTER_TOKEN }} | ||
|
||
|
@@ -104,9 +113,16 @@ jobs: | |
- name: Tag the latest commit | ||
run: | | ||
cd ezkl-swift-package | ||
source $GITHUB_ENV | ||
# Tag the latest commit on the current branch | ||
git tag ${{ github.event.inputs.tag }} | ||
if ! git push origin ${{ github.event.inputs.tag }}; then | ||
echo "::error::Failed to push tag '${{ github.event.inputs.tag }}' to ${{ env.EZKL_SWIFT_PACKAGE_REPO }}. Please ensure EZKL_PORTER_TOKEN has correct permissions." | ||
if git rev-parse "$TAG" >/dev/null 2>&1; then | ||
echo "Tag $TAG already exists locally. Skipping tag creation." | ||
else | ||
git tag "$TAG" | ||
fi | ||
if ! git push origin "$TAG"; then | ||
echo "::error::Failed to push tag '$TAG' to ${{ env.EZKL_SWIFT_PACKAGE_REPO }}. Please ensure EZKL_PORTER_TOKEN has correct permissions." | ||
exit 1 | ||
fi |