-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate test release workflow (#78)
- Loading branch information
Showing
1 changed file
with
74 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,74 @@ | ||
name: Deploy | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
start-release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
outputs: | ||
package_mui: ${{ steps.version-mono.outputs.package_mui }} | ||
package_api: ${{ steps.version-mono.outputs.package_api }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- id: version-mono | ||
run: | | ||
git config --global user.name "$GITHUB_ACTOR" | ||
git config --global user.email "[email protected]" | ||
git rev-list --tags --skip=1 --max-count=1 | ||
PREV_TAG_HASH=$(git rev-list --tags --skip=1 --max-count=1) | ||
PREV_TAG=$(git describe --abbrev=0 --tags $PREV_TAG_HASH) | ||
MODIFIED_PACKAGES=$(git diff --name-only "$GITHUB_REF_NAME" "$PREV_TAG" | grep "^packages\/*" | cut -d / -f2 | sort | uniq) | ||
echo "packages are $MODIFIED_PACKAGES" | ||
echo "packages=$MODIFIED_PACKAGES" | ||
echo "packages=$MODIFIED_PACKAGES" >> "$GITHUB_OUTPUT" | ||
for p in $(git diff --name-only "v0.16.0" "v0.15.0" | grep "^packages\/*" | cut -d / -f2 | sort | uniq); do | ||
echo "package_$p=true" | ||
echo "package_$p=true" >> "$GITHUB_OUTPUT" | ||
done | ||
echo "TODO BRANCH AND VERSION MONO REPO" | ||
package-mui: | ||
needs: [start-release] | ||
if: needs.start-release.outputs.package_mui == 'true' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build Package A | ||
env: | ||
ALL_PACKAGES: ${{ needs.start-release.outputs.packages}} | ||
PACKAGE_NAME: a | ||
DO_PACKAGE: ${{ needs.start-release.outputs.package_mui }} | ||
run: | | ||
echo "PACKAGES ARE \""$ALL_PACKAGES"\" \""$DO_PACKAGE"\"" | ||
if ! [[ $DO_PACKAGE != true ]]; then | ||
echo "$PACKAGE_NAME unchanged - will not build" | ||
exit | ||
fi | ||
echo "BUILD IT" | ||
package-api: | ||
needs: [start-release] | ||
if: needs.start-release.outputs.package_api == 'true' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build Package B | ||
env: | ||
ALL_PACKAGES: ${{ needs.start-release.outputs.packages }} | ||
PACKAGE_NAME: b | ||
DO_PACKAGE: ${{ needs.start-release.outputs.package_api }} | ||
run: | | ||
echo "PACKAGES ARE \""$ALL_PACKAGES"\" \""$DO_PACKAGE"\"" | ||
if ! [[ $DO_PACKAGE != true ]]; then | ||
echo "$PACKAGE_NAME unchanged - will not build" | ||
exit | ||
fi | ||
echo "BUILD IT" |