generated from mattrobmattrob/bazel-ios-swiftui-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copied off of https://github.com/bazel-ios/rules_ios/blob/master/.github/workflows/create_release.yml Signed-off-by: Matt Robinson <[email protected]>
- Loading branch information
1 parent
8b3d75e
commit 6bd3fd0
Showing
2 changed files
with
68 additions
and
0 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,46 @@ | ||
name: Create Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'The new version to tag, ex: x.x.x' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Create Release | ||
run: | | ||
set -euo pipefail | ||
git config user.name "Release Workflow" | ||
git config user.email "[email protected]" | ||
# Archive the repository | ||
COPYFILE_DISABLE=1 tar czvf "swift-bep-parser.$TAG.tar.gz" \ | ||
--exclude="./bazel-*" \ | ||
--exclude="user.bazelrc" \ | ||
--exclude=".DS_Store" \ | ||
--exclude="*.xcodeproj" \ | ||
--exclude="Tests/" \ | ||
--exclude="README.md" \ | ||
./* | ||
# Create the release notes | ||
./.github/workflows/generate_release_notes.sh "$TAG" | tee notes.md | ||
# Create the release | ||
gh release create "$TAG" \ | ||
--title "$TAG" \ | ||
--target "$GITHUB_REF_NAME" \ | ||
--generate-notes \ | ||
--notes-file notes.md \ | ||
"rules_ios.$TAG.tar.gz" | ||
env: | ||
TAG: ${{ inputs.tag }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,22 @@ | ||
#!/bin/bash | ||
|
||
set -exuo pipefail | ||
|
||
# This script generates release notes for a release. | ||
# It uses the new tag and archive to generate a workspace snippet. | ||
# It is primarily used by the `create_release.yml` workflow. | ||
# Args: | ||
# - The first argument is the new version number. | ||
|
||
readonly new_version=$1 | ||
readonly release_archive="swift-bep-parser.$new_version.tar.gz" | ||
|
||
sha=$(shasum -a 256 "$release_archive" | cut -d " " -f1) | ||
|
||
cat <<EOF | ||
### Bzlmod Snippet | ||
\`\`\`bzl | ||
bazel_dep(name = "swift_bep_parser", version = "$new_version") | ||
\`\`\` | ||
EOF |