Build Release #5
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
name: Build Release | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
packagePath: . | |
steps: | |
# Checkout Local Repository | |
- name: Checkout | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
# Get the Package version based on the package.json file | |
- name: Get Version | |
id: version | |
uses: zoexx/github-action-json-file-properties@b9f36ce6ee6fe2680cd3c32b2c62e22eade7e590 | |
with: | |
file_path: "${{ env.packagePath }}/package.json" | |
prop_path: "version" | |
- name: Get Package Name | |
id: name | |
uses: zoexx/github-action-json-file-properties@b9f36ce6ee6fe2680cd3c32b2c62e22eade7e590 | |
with: | |
file_path: "${{ env.packagePath }}/package.json" | |
prop_path: "name" | |
- name: Set Environment Variables | |
run: | | |
echo "zipFile=${{ steps.name.outputs.value }}-${{ steps.version.outputs.value }}".zip >> $GITHUB_ENV | |
echo "unityPackage=${{ steps.name.outputs.value }}-${{ steps.version.outputs.value }}.unitypackage" >> $GITHUB_ENV | |
echo "version=${{ steps.version.outputs.value }}" >> $GITHUB_ENV | |
# Zip the Package for release | |
- name: Create Package Zip | |
working-directory: "${{ env.packagePath }}" | |
run: zip -r "${{ github.workspace }}/${{ env.zipFile }}" . -x '.*' '*/.*' | |
# Build a list of .meta files for future use | |
- name: Track Package Meta Files | |
run: find "${{ env.packagePath }}/" -name \*.meta >> metaList | |
# Make a release tag of the version from the package.json file | |
- name: Create Tag | |
id: tag_version | |
uses: rickstaa/action-create-tag@88dbf7ff6fe2405f8e8f6c6fdfd78829bc631f83 | |
with: | |
tag: "${{ env.version }}" | |
beta: ${{ github.ref == 'refs/heads/dev' }} | |
# Publish the Release to GitHub | |
- name: Make Release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | |
with: | |
files: | | |
${{ env.zipFile }} | |
${{ env.packagePath }}/package.json | |
tag_name: ${{ env.version }} | |
prerelease: ${{ github.ref == 'refs/heads/dev' }} | |
- name: call-build-listing | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: build-listing.yml | |
repo: Tliks/vpm-repos | |
token: ${{ secrets.DISPATCH_TOKEN }} | |
ref: main | |