-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow_dispatch trigger for release (#24)
* Add release workflow * Fix sed * configure git user * Push branch as well * Release 6.0.0-pre612b5dd8a9d4f15c9884a2280de88f3e9ba53073 * Update Package.swift --------- Co-authored-by: GitHub Actions <[email protected]>
- Loading branch information
Showing
2 changed files
with
59 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
download_url: | ||
description: URL where zip containing XCFramework can be downloaded | ||
required: true | ||
type: string | ||
version: | ||
description: Version number of release | ||
required: true | ||
type: string | ||
changelog: | ||
description: Changelog for release | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download zip, compute checksum | ||
run: | | ||
wget ${{ github.event.inputs.download_url }} | ||
echo checksum="$(swift package compute-checksum MapLibre.dynamic.xcframework.zip)" >> "$GITHUB_ENV" | ||
- name: Insert new checksum in Package.swift | ||
run: | | ||
sed -i 's#\(checksum: "\)\([^"]*\)#\1${{ env.checksum }}#' Package.swift | ||
- name: Insert download URL in Package.swift | ||
run: | | ||
sed -i 's#\(url: "\)\([^"]*\)#\1${{ github.event.inputs.download_url }}#' Package.swift | ||
- name: Validate Package.swift | ||
run: swift package describe | ||
|
||
- name: Push Package.swift | ||
run: | | ||
git add Package.swift | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git commit -m "Release ${{ github.event.inputs.version }}" | ||
git tag -a ${{ github.event.inputs.version }} -m "Release ${{ github.event.inputs.version }}" | ||
git push --atomic origin main ${{ github.event.inputs.version }} | ||
- name: Make release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ github.event.inputs.version }} | ||
tag_name: ${{ github.event.inputs.version }} | ||
prerelease: ${{ contains(github.event.inputs.version, 'pre') }} | ||
body_path: ${{ github.event.inputs.changelog }} |
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