Skip to content

Uploadできない不具合の修正 #115

Uploadできない不具合の修正

Uploadできない不具合の修正 #115

Workflow file for this run

name: Build Release
on:
workflow_dispatch:
push:
branch: "main"
jobs:
# Validate Repository Configuration
config:
runs-on: ubuntu-latest
outputs:
config_package: ${{ steps.config_package.outputs.configPackage }}
steps:
# Ensure that required repository variable has been created for the Package
- name: Validate Package Config
id: config_package
run: |
echo "configPackage=true" >> $GITHUB_OUTPUT;
# Get Version
GetTargetVersion:
needs: config
runs-on: ubuntu-latest
outputs:
TargetVersion: ${{ steps.version.outputs.value }}
TagExist: ${{ steps.contains_tag.outputs.retval }}
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"
# Check Exist
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: rickstaa/action-contains-tag@v1
id: contains_tag
with:
reference: "main"
tag: "${{ steps.version.outputs.value }}"
frail: false
# Build and release the Package
# If the repository is not configured properly, this job will be skipped
build:
needs: GetTargetVersion
runs-on: ubuntu-latest
permissions:
contents: write
env:
packagePath: .
if: always() && (needs.GetTargetVersion.outputs.TagExist == 'false')
steps:
# Checkout Local Repository
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
#Configure the Environment Variables needed for releasing the Package
- name : Set Environment Variables1
run: |
echo "version=${{ needs.GetTargetVersion.outputs.TargetVersion }}" >> $GITHUB_ENV
echo "RepoName=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}" >> $GITHUB_ENV
- name : Set Environment Variables2
run: |
echo "zipFile=${{ env.RepoName }}-${{ env.version }}".zip >> $GITHUB_ENV
# Zip the Package for release
- name: Create Package Zip
working-directory: "${{ env.packagePath }}"
run: zip "${{ github.workspace }}/${{ env.zipFile }}" ./* -r -x .github .git '.git/*' '*~/*' '*.ps1*'
# 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 }}"
# 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 }}
- name: Update Website
if: ${{ !contains(env.version, 'Beta') && !contains(env.version, 'beta') }}
run: |
TOKEN=${{ secrets.MY_PAT }}
curl \
-X POST \
-H "Authorization: token $TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/pandrabox/vpm/dispatches \
-d '{"event_type":"automatic-web-update","client_payload":{"env": "dev"}}'