From a939416bee1fdd91ce82efa948d298978fe5b2e4 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 23 Apr 2024 15:48:41 +0100 Subject: [PATCH] fix(release-to-candidate): fix broken manifests when `project_root` is used In cases where project root is used, the workflow changes directory, and then writes the manifest. In subsequent steps, a manifest is written without changing directory, meaning there is incomplete information, resulting in broken tables as seen in this issue: https://github.com/snapcrafters/ffmpeg-sdk/issues/12 --- release-to-candidate/action.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/release-to-candidate/action.yaml b/release-to-candidate/action.yaml index 70c5a84..3405a29 100644 --- a/release-to-candidate/action.yaml +++ b/release-to-candidate/action.yaml @@ -65,7 +65,6 @@ runs: id: build shell: bash env: - SNAPCRAFT_REMOTE_BUILD_STRATEGY: "disable-fallback" arch: ${{ inputs.architecture }} name: ${{ steps.snapcraft-yaml.outputs.snap-name }} yaml_path: ${{ steps.snapcraft-yaml.outputs.yaml-path }} @@ -76,7 +75,8 @@ runs: # https://bugs.launchpad.net/snapcraft/+bug/1885150 yq -i '.architectures |= [{"build-on": env(arch)}]' "$yaml_path" - cd "$project_root" && git init || exit + pushd "$project_root" && git init || exit + if ! snapcraft remote-build --launchpad-accept-public-upload; then cat "${name}_${arch}.txt" fi @@ -88,13 +88,15 @@ runs: exit 1 fi + popd || exit + # Write the manifest file which is used by later steps echo "snap=${name}_${version}_${arch}.snap" >> "$GITHUB_OUTPUT" if [[ -n "$project_root" ]]; then echo "snap=${project_root}/${name}_${version}_${arch}.snap" >> "$GITHUB_OUTPUT" fi - echo "name: ${name}" >> "manifest-${arch}.yaml" - echo "architecture: ${arch}" >> "manifest-${arch}.yaml" + echo "name: ${name}" >> "manifest-${{ inputs.architecture }}.yaml" + echo "architecture: ${arch}" >> "manifest-${{ inputs.architecture }}.yaml" - name: Review the built snap uses: diddlesnaps/snapcraft-review-action@v1