Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ runs:
mkdir -p .rock/cache
echo "{\"githubToken\": \"${{ inputs.github-token }}\"}" > .rock/cache/project.json
shell: bash
working-directory: ${{ inputs.working-directory }}
# We create PR-related artifacts to avoid overwriting the main artifact with new JS bundle
- name: Check if PR-related artifact exists
if: ${{ github.event_name == 'pull_request' && inputs.re-sign == 'true' }}
Expand All @@ -163,6 +164,7 @@ runs:
echo "ARTIFACT_NAME=$(echo "$OUTPUT" | jq -r '.name')" >> $GITHUB_ENV
fi
shell: bash
working-directory: ${{ inputs.working-directory }}

- name: Check if regular artifact exists
if: ${{ !env.ARTIFACT_NAME }}
Expand All @@ -177,6 +179,7 @@ runs:
echo "ARTIFACT_NAME=$(echo "$OUTPUT" | jq -r '.name')" >> $GITHUB_ENV
fi
shell: bash
working-directory: ${{ inputs.working-directory }}
- name: Set Artifact Name (if not set)
if: ${{ !env.ARTIFACT_NAME }}
run: |
Expand Down Expand Up @@ -273,6 +276,7 @@ runs:
echo BINARY_PATH $BINARY_PATH
echo "ARTIFACT_PATH=$BINARY_PATH" >> $GITHUB_ENV
shell: bash
working-directory: ${{ inputs.working-directory }}

- name: Validate ELF Alignment
if: ${{ inputs.validate-elf-alignment == 'true' && !env.ARTIFACT_URL && env.ARTIFACT_PATH }}
Expand All @@ -288,6 +292,7 @@ runs:
BINARY_PATH=$(echo "$DOWNLOAD_OUTPUT" | jq -r '.path')
echo "ARTIFACT_PATH=$BINARY_PATH" >> $GITHUB_ENV
shell: bash
working-directory: ${{ inputs.working-directory }}

- name: Re-sign Binary
if: ${{ env.ARTIFACT_URL && inputs.re-sign == 'true' }}
Expand Down Expand Up @@ -341,6 +346,7 @@ runs:
echo "ARTIFACT_ID=$(echo "$OUTPUT" | jq -r '.id')" >> $GITHUB_ENV
fi
shell: bash
working-directory: ${{ inputs.working-directory }}
# Special case for GitHub, as it doesn't support uploading through the API
- name: Upload Artifact to GitHub
id: upload-artifact
Expand All @@ -360,6 +366,7 @@ runs:
OUTPUT=$(npx rock remote-cache upload --name ${{ env.ARTIFACT_NAME }} --binary-path "${{ env.ARTIFACT_PATH }}" --json --verbose) || (echo "$OUTPUT" && exit 1)
echo "ARTIFACT_URL=$(echo "$OUTPUT" | jq -r '.url')" >> $GITHUB_ENV
shell: bash
working-directory: ${{ inputs.working-directory }}

# Upload ZIP Artifact with {fingerprint}-only name as base ZIP Artifact for caching only (first build only).
# Runs only when no cached artifact exists (!ARTIFACT_URL), meaning native build was done from scratch.
Expand All @@ -373,6 +380,7 @@ runs:
OUTPUT=$(npx rock remote-cache upload --name ${{ env.ARTIFACT_NAME }} --json --verbose) || (echo "$OUTPUT" && exit 1)
echo "ARTIFACT_URL=$(echo "$OUTPUT" | jq -r '.url')" >> $GITHUB_ENV
shell: bash
working-directory: ${{ inputs.working-directory }}


# Ad-hoc uploads always include an identifier in the name {identifier}-{fingerprint}
Expand All @@ -392,12 +400,14 @@ runs:
OUTPUT=$(npx rock remote-cache upload --name ${{ env.ADHOC_ARTIFACT_NAME }} --binary-path "${{ env.ARTIFACT_PATH }}" --json --ad-hoc) || (echo "$OUTPUT" && exit 1)
echo "ARTIFACT_URL=$(echo "$OUTPUT" | jq -r '.url')" >> $GITHUB_ENV
shell: bash
working-directory: ${{ inputs.working-directory }}

- name: Delete Old Re-Signed Artifacts
if: ${{ env.ARTIFACT_URL && inputs.re-sign == 'true' && github.event_name == 'pull_request' }}
run: |
npx rock remote-cache delete --name ${{ env.ARTIFACT_NAME }} --all-but-latest --json
shell: bash
working-directory: ${{ inputs.working-directory }}

- name: Clean Up Keystore
if: ${{ (!env.ARTIFACT_URL && inputs.sign) || (env.ARTIFACT_URL && inputs.re-sign) }}
Expand Down
Loading