Skip to content

Commit

Permalink
chore: migrate test release workflow (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahg authored Feb 22, 2024
1 parent 12b0306 commit a56fee8
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/release.yaml
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"

0 comments on commit a56fee8

Please sign in to comment.