| name: Create Release |
| |
| on: |
| workflow_dispatch: |
| inputs: |
| tag: |
| description: 'The new version to tag, ex: 1.0.5' |
| required: true |
| type: string |
| |
| jobs: |
| create-release: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v2 |
| - name: Create Release |
| run: | |
| set -euo pipefail |
| |
| COPYFILE_DISABLE=1 tar czvf "apple_support.$TAG.tar.gz" ./* |
| ./.github/generate-notes.sh "$TAG" | tee notes.md |
| |
| # Add generated API docs to the release |
| # See https://github.com/bazelbuild/bazel-central-registry/blob/main/docs/stardoc.md |
| docs="$(mktemp -d)"; targets="$(mktemp)" |
| bazel --output_base="$docs" query --output=label --output_file="$targets" 'kind("starlark_doc_extract rule", //...)' |
| bazel --output_base="$docs" build --target_pattern_file="$targets" |
| tar --create --auto-compress \ |
| --directory "$(bazel --output_base="$docs" info bazel-bin)" \ |
| --file "apple_support.$TAG.docs.tar.gz" . |
| |
| gh release create "$TAG" --title "$TAG" --target "$GITHUB_REF_NAME" --notes-file notes.md "apple_support.$TAG.tar.gz" "apple_support.$TAG.docs.tar.gz" |
| env: |
| TAG: ${{ inputs.tag }} |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |