question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Artifacts being published to S3 when they shouldn't be

See original GitHub issue
  • Version: 20.5.1
  • Target: macOS, Linux and Windows

The building artifacts are always being published to S3 and consequently, the auto-update files are being updated. This is happening on Travis CI using the following configuration:

electron-builder.json

{
  "appId": "io.lbry.LBRY",
  "productName": "LBRY",
  "publish": [
    {
      "provider": "s3",
      "bucket": "build.lbry.io",
      "path": "app/release",
      "region": "us-east-1"
    },
    "github"
  ],
  "mac": {
    "category": "public.app-category.entertainment"
  },
  "dmg": {
    "iconSize": 128,
    "contents": [
      {
        "x": 115,
        "y": 164
      },
      {
        "x": 387,
        "y": 164,
        "type": "link",
        "path": "/Applications"
      }
    ],
    "window": {
      "x": 200,
      "y": 200,
      "width": 500,
      "height": 300
    },
    "background": "./build/background.png"
  },
  "protocols": [
    {
      "name": "LBRY URI",
      "schemes": ["lbry"],
      "role": "Viewer"
    }
  ],
  "linux": {
    "target": "deb",
    "category": "AudioVideo;Video",
    "desktop": {
      "MimeType": "x-scheme-handler/lbry;"
    }
  },
  "deb": {
    "depends": [
      "gconf2",
      "gconf-service",
      "libnotify4",
      "libappindicator1",
      "libxtst6",
      "libnss3",
      "libsecret-1-0"
    ]
  },
  "nsis": {
    "perMachine": true
  },
  "beforeBuild": "./build/checkDaemonPlatform.js"
}

.travis.yml

matrix:
  include:
    - os: osx
      osx_image: xcode9.2
      language: node_js
      node_js: "9"
      env:
        - ELECTRON_CACHE=$HOME/.cache/electron
        - ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
    - os: linux
      services: docker
      language: generic
before_cache:
  - rm -rf $HOME/.cache/electron-builder/wine
cache:
  directories:
  - node_modules
  - $HOME/.cache/electron
  - $HOME/.cache/electron-builder
before_install:
  - |
    if [ "$TRAVIS_OS_NAME" == "osx" ]; then
      mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v2.3.1/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-2.3.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1
      export PATH="/tmp/git-lfs:$PATH"
    fi
before_script:
  - git lfs pull
script:
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      docker run --rm \
        --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \
        -v ${PWD}:/project \
        -v ~/.cache/electron:/root/.cache/electron \
        -v ~/.cache/electron-builder:/root/.cache/electron-builder \
        electronuserland/builder:wine \
        /bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn build --linux --win"
    else
      yarn build
    fi
branches:
  except:
    - "/^v\\d+\\.\\d+\\.\\d+$/"
addons:
  artifacts:
    working_dir: dist
    paths:
     - $(git ls-files -o dist/{*.dmg,*.exe,*.deb} | tr "\n" ":")
    target_paths:
     - /app/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})

Here’s a build on which the files were uploaded to the S3 bucket when they shouldn’t have: https://travis-ci.org/lbryio/lbry-app/jobs/354537632

This is a big problem because users are prompted to upgrade their app for non-released builds and even for builds from non-master branches. I’m providing a donation for this issue.

Our repository source code fixed at the current commit: https://github.com/lbryio/lbry-app/tree/861131fd774dda6344f607290efdd6bfdf66312d

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
IGassmanncommented, Mar 18, 2018

@develar According to the documentation, electron-builder is supposed to only publish if there’s a draft open, the commit is tagged, or if the npm script is named release. In the build linked above, any of those cases are happening.

0reactions
develarcommented, Mar 27, 2018

Thanks for spotting this issue and for donation. Problem — onTagOrDraft policy is set, but draft concept applicable only for GitHub and Bintray, not for other providers. Now we check that tag exists for such providers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Publishing Android Library Artifacts to Amazon S3 Buckets
Run the publish task and you should see a bunch of lines where files are being uploaded to your S3 bucket. This is...
Read more >
Deploy artifacts to Amazon S3 in different accounts using ...
1. Open the IAM console in the production account. · 2. In the navigation pane, choose Roles. · 3. Choose Another AWS account....
Read more >
Using GitHub Actions to Deploy to S3 | Alex Hyett
I did try to compile it in the docker image but I couldn't get the correct version to be picked up when running...
Read more >
Using S3 Bucket as Maven private repository with gradle
The problem you are facing is for wrong S3 Url pattern. There are two interfaces extends from base Credentials interface.
Read more >
Unable to use dynamic versions with an S3-based ivy ...
ivy2/repo/com.razerzone/library-publishing/[revision]/ivy-[revision].xml 13:39:27.242 [DEBUG] [org.gradle.api.internal.artifacts.repositories.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found