Merge tag 'v1.1.2' #43
Workflow file for this run
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
name: SwiftRelease | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
push: | |
tags: | |
- '**' | |
env: | |
SOURCE_REF: ${{ github.event_name == 'release' && github.ref_name || 'main' }} | |
TARGET_REPO: 'duckdb/duckdb-swift' | |
TARGET_REF: 'main' | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
jobs: | |
update: | |
name: Update Swift Repo | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source Repo | |
uses: actions/checkout@v4 | |
with: | |
# we need tags for the ubiquity build script to run without errors | |
fetch-depth: '0' | |
ref: ${{ env.SOURCE_REF }} | |
path: 'source-repo' | |
- name: Checkout Target Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ env.TARGET_REPO }} | |
ref: ${{ env.TARGET_REF }} | |
token: ${{ env.GH_TOKEN }} | |
path: 'target-repo' | |
- name: Generate Swift Package | |
run: python3 source-repo/tools/swift/create_package.py source-repo/tools/swift | |
- name: Package Update | |
run: | | |
mkdir updated-repo | |
mv -v target-repo/.git updated-repo/.git | |
mv -v source-repo/tools/swift/duckdb-swift/* updated-repo/ | |
- name: Commit Updated Repo | |
run: | | |
git -C updated-repo config user.name github-actions | |
git -C updated-repo config user.email [email protected] | |
git -C updated-repo add -A | |
if [[ $(git -C updated-repo status --porcelain) ]]; then | |
git -C updated-repo commit -m "automated update" | |
fi | |
- name: Push Update | |
run: | | |
git -C updated-repo push | |
- name: Tag Release | |
run: | | |
cd source-repo | |
export TAG_NAME=`python3 -c "import sys, os; sys.path.append(os.path.join('scripts')); import package_build; print(package_build.git_dev_version())"` | |
cd .. | |
git -C updated-repo tag -a $TAG_NAME -m "Release $TAG_NAME" | |
git -C updated-repo push origin $TAG_NAME |