Skip to content

Commit

Permalink
Switch to manual iOS pre-releases (#2003)
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers authored Jan 8, 2024
1 parent ab83392 commit 8c940cb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/ios-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ on:
workflow_dispatch:
inputs:
release:
required: false
type: boolean
description: Makes a release with version platform/ios/VERSION
type: choice
default: no
options:
- full
- pre
- no
description: Whether to make a release, choose full release (uses platform/ios/VERSION) or pre-release
push:
branches:
- main
Expand Down Expand Up @@ -199,7 +203,7 @@ jobs:

# Make Metal XCFramework release
- name: Should make release?
if: ${{ github.ref == 'refs/heads/main' }}
if: github.event.inputs.release == 'full' || github.event.inputs.release == 'pre'
run: echo make_release=true >> "$GITHUB_ENV"

- name: Build XCFramework
Expand All @@ -208,17 +212,21 @@ jobs:
echo xcframework="$(bazel info execution_root)"/"$(bazel cquery --output=files --compilation_mode=opt --//:renderer=metal --//:maplibre_platform=ios //platform/ios:MapLibre.dynamic)" >> "$GITHUB_ENV"
- name: Get version (release)
if: env.make_release && github.event.inputs.release
run: echo version="$(cat VERSION)" >> "$GITHUB_ENV"
if: github.event.inputs.release == 'full'
run: |
echo version="$(head VERSION)" >> "$GITHUB_ENV"
echo changelog_version_heading="## {{ env.version }}" >> "$GITHUB_ENV"
- name: Get version (pre-release)
if: env.make_release && !github.event.inputs.release
run: echo version="$(cat VERSION)"-pre${{ github.sha }} >> "$GITHUB_ENV"
if: github.event.inputs.release == 'pre'
run: |
echo version="$(head VERSION)"-pre${{ github.sha }} >> "$GITHUB_ENV"
echo changelog_version_heading="## main" >> "$GITHUB_ENV"
- name: Extract changelog for version
if: env.make_release
run: |
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "## {{ env.version }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "{{ env.changelog_version_heading }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
cat changelog_for_version.md
- name: Create tag
Expand Down Expand Up @@ -268,13 +276,13 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/maplibre/maplibre-gl-native-distribution/actions/workflows/$release_workflow_id/dispatches \
-d '{"ref":"main","inputs":{ \
"changelog": '"$(cat changelog_for_version.md)"', \
"changelog": "'"$(cat changelog_for_version.md)"'", \
"version":"${{ env.version }}", \
"download_url":"${{ fromJSON(steps.github_release.outputs.assets)[0].browser_download_url }}"}}'
- name: Release (CocoaPods)
shell: bash -leo pipefail {0} # so pod is found
if: env.make_release && github.event.inputs.release
if: env.make_release
run: |
VERSION=${{ env.version }} COCOAPODS_TRUNK_TOKEN=${{ secrets.COCOAPODS_PASSWORD }} pod trunk push MapLibre.podspec
Expand Down
22 changes: 19 additions & 3 deletions platform/ios/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
# Instructions for making an iOS release

We make iOS releases to GitHub (a downloadable XCFramework), the [Swift Package Index](https://swiftpackageindex.com/maplibre/maplibre-gl-native-distribution) and [CocoaPods](https://cocoapods.org/). Everyone with write access to the repository is able to make releases using the instructions below.

## Pre-release

Run the `ios-ci` workflow. You can use the [GitHub CLI](https://cli.github.com/manual/gh_workflow_run):

```
gh workflow run ios-ci.yml -f release=pre --ref main
```

Or run the workflow from the Actions tab on GitHub.

The items under the `## main` heading in `platform/ios/CHANGELOG.md` will be used as changelog for the pre-release.

## Full release

1. Make sure the `VERSION` file in `platform/ios/VERSION` contains the version to be released. We use semantic versioning, so any breaking changes require a major version bump.

2. Update the changelog, which can be found in `platform/ios/CHANGELOG.md`. The heading must match `## <VERSION>` exactly, or it will not be picked up. For example, for version 6.0.0:

```
```md
## 6.0.0
```

3. Run the `ios-ci` workflow. You can use the [GitHub CLI](https://cli.github.com/manual/gh_workflow_run):

```
gh workflow run ios-ci.yml -f release=true --ref main
gh workflow run ios-ci.yml -f release=full --ref main
```

Or run the workflow from the Actions tab on GitHub:

<img width="333" alt="Screenshot 2024-01-07 at 16 23 50" src="https://github.com/maplibre/maplibre-native/assets/649392/a0440e05-c522-49ba-ae85-3fc2193de465">
<img width="367" alt="Screenshot 2024-01-08 at 11 00 30" src="https://github.com/maplibre/maplibre-native/assets/649392/ae791f04-f805-4544-b33a-44d8b04e0836">

0 comments on commit 8c940cb

Please sign in to comment.