Skip to content

Update README.

Update README. #11

Workflow file for this run

# Run this Action on creating a new tag matching "<library>-<version>-<build>"
# e.g., foobar-1.2.3-1
name: Release build
on:
push:
tags:
- '*-*-*'
jobs:
build:
name: Build
runs-on: macOS-latest
outputs:
PACKAGE_NAME: ${{ steps.build-vars.outputs.PACKAGE_NAME }}
PACKAGE_VERSION: ${{ steps.build-vars.outputs.PACKAGE_VERSION }}
BUILD_NUMBER: ${{ steps.build-vars.outputs.BUILD_NUMBER }}
strategy:
matrix:
target: [ "iOS", "tvOS", "watchOS" ]
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set Build Variables
id: build-vars
env:
TAG_NAME: ${{ github.ref }}
run: |
export TAG=$(basename $TAG_NAME)
echo "TAG=${TAG}"
export PACKAGE_NAME_VERSION="${TAG%-*}"
export PACKAGE_NAME="${PACKAGE_NAME_VERSION%-*}"
export PACKAGE_VERSION="${PACKAGE_NAME_VERSION#*-}"
export BUILD_NUMBER="${TAG#*-*-}"
echo "PACKAGE_NAME=${PACKAGE_NAME}" | tee -a ${GITHUB_OUTPUT}
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a ${GITHUB_OUTPUT}
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: "3.X"
- name: Build ${{ matrix.target }}
run: |
# Do the build for the requested target.
make ${{ steps.build-vars.outputs.PACKAGE_NAME }}-${{ matrix.target }} $(echo "${{ steps.build-vars.outputs.PACKAGE_NAME }}" | tr 'a-z' 'A-Z')_VERSION=${{ steps.build-vars.outputs.PACKAGE_VERSION }} BUILD_NUMBER=${{ steps.build-vars.outputs.BUILD_NUMBER }}
- name: Upload Build Artifact
uses: actions/upload-artifact@v4.3.4
with:
name: dist-${{ matrix.target }}
path: dist
if-no-files-found: error
make-release:
name: Make Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Get Build Artifacts
uses: actions/download-artifact@v4.1.8
with:
pattern: dist-*
path: dist
merge-multiple: true
- name: Create Release
uses: ncipollo/release-action@v1.14.0
with:
name: ${{ needs.build.outputs.PACKAGE_NAME }} v${{ needs.build.outputs.PACKAGE_VERSION }} (build ${{ needs.build.outputs.BUILD_NUMBER }})
draft: true
body: |
Build ${{ needs.build.outputs.BUILD_NUMBER }} of ${{ needs.build.outputs.PACKAGE_NAME }} v${{ needs.build.outputs.PACKAGE_VERSION }}.
artifacts: "dist/*"