Skip to content

Merge pull request #24 from cybozu/modify-for-xcode-cloud #15

Merge pull request #24 from cybozu/modify-for-xcode-cloud

Merge pull request #24 from cybozu/modify-for-xcode-cloud #15

name: Release Artifact Bundle
on:
push:
tags:
- "*.*.*"
jobs:
release-artifact-bundle:
name: Release Artifact Bundle
runs-on: macos-14
timeout-minutes: 20
env:
DEVELOPER_DIR: "/Applications/Xcode_15.2.app/Contents/Developer"
ARTIFACT_BUNDLE: "swift-packages-parser.artifactbundle"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Show Xcode Version
run: xcodebuild -version
- name: Build SwiftPackagesParser
run: swift build -c release --product spp --arch arm64 --arch x86_64
- name: Show SwiftPackagesParser size
run: ls -Slh .build/apple/Products/Release/spp | awk '{print $5, $9}'
- name: Set Env
run: |
echo "VERSION_STRING=${{ github.ref_name }}" >> $GITHUB_ENV
echo "ARTIFACT_BUNDLE_PATH=${ARTIFACT_BUNDLE}/spp-${{ github.ref_name }}-macos/bin" >> $GITHUB_ENV
echo "TODAY=$(env LANG=en_US.UTF-8 date "+(%b %d, %Y)")" >> $GITHUB_ENV
- name: Make Output Directory
run: mkdir -p "${ARTIFACT_BUNDLE_PATH}"
- name: Make Artifact Bundle
run: |
sed "s/__VERSION__/${VERSION_STRING}/g" info-macos.json.template > "${ARTIFACT_BUNDLE}/info.json"
cp -f ".build/apple/Products/Release/spp" "${ARTIFACT_BUNDLE_PATH}"
cp -f LICENSE "${ARTIFACT_BUNDLE}"
zip -yr - "${ARTIFACT_BUNDLE}" > "./swift-packages-parser-macos.artifactbundle.zip"
- name: Get checksum
run: |
CHECKSUM=$(swift package compute-checksum ./swift-packages-parser-macos.artifactbundle.zip)
echo ${CHECKSUM}
echo "CHECKSUM=${CHECKSUM}" >> $GITHUB_ENV
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: "${{ github.ref_name }} ${{ env.TODAY }}"
tag_name: ${{ github.ref_name }}
body: "**checksum**: ${{ env.CHECKSUM }}"
files: "./swift-packages-parser-macos.artifactbundle.zip"
draft: false
prerelease: false