From 689750034a5dccde588bee2823ca623c1e010ea1 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 24 Nov 2021 11:46:22 +0100 Subject: [PATCH] Create publish-action.yml Update publish-action.yml Update publish-action.yml Update publish-action.yml Update publish-action.yml Update publish-action.yml Update publish-action.yml export hash only to env output links mix events multi events on push labeled --- .github/workflows/publish-action.yml | 27 +++++++++++++++++++++++++++ apps/remix-ide/ci/publishIpfs | 5 +---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish-action.yml diff --git a/.github/workflows/publish-action.yml b/.github/workflows/publish-action.yml new file mode 100644 index 0000000000..b023c4ffcc --- /dev/null +++ b/.github/workflows/publish-action.yml @@ -0,0 +1,27 @@ +name: remix-publish-action +on: + pull_request: + types: [ labeled ] +jobs: + build: + if: ${{ github.event.label.name == 'publish' }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - run: npm install + - run: ls + - run: pwd + - run: npm run downloadsolc_assets + - run: npm run build:production + - run: echo "action_state=$('./apps/remix-ide/ci/publishIpfs')" >> $GITHUB_ENV + - uses: mshick/add-pr-comment@v1 + with: + message: | + ipfs://${{ env.action_state }} + https://ipfs.remixproject.org/ipfs/${{ env.action_state }} + https://gateway.ipfs.io/ipfs/${{ env.action_state }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens + allow-repeats: false # This is the default + diff --git a/apps/remix-ide/ci/publishIpfs b/apps/remix-ide/ci/publishIpfs index e37cba38e3..0f8fd96ca0 100755 --- a/apps/remix-ide/ci/publishIpfs +++ b/apps/remix-ide/ci/publishIpfs @@ -2,7 +2,6 @@ const IpfsHttpClient = require('ipfs-http-client') const { globSource } = IpfsHttpClient -console.log('current folder', process.cwd()) const folder = process.cwd() + '/dist/apps/remix-ide'; (async () => { @@ -11,9 +10,7 @@ const folder = process.cwd() + '/dist/apps/remix-ide'; try { let result = await ipfs.add(globSource(folder, { recursive: true}), { pin: false }) const hash = result.cid.toString() - console.log('ipfs://' + hash) - console.log('https://ipfs.remixproject.org/ipfs/' + hash) - console.log('https://gateway.ipfs.io/ipfs/' + hash) + console.log(hash) } catch (e) { console.log(e) }