Skip to content

Commit

Permalink
fix: resolve issues with automated releases (#1974)
Browse files Browse the repository at this point in the history
* chore: don't npm publish unwanted files

* fix: download car artifact

* fix: Only release on manual ci.yml workflow dispatch
  • Loading branch information
SgtPooki authored Jul 20, 2022
1 parent 95a7671 commit 9a7cfad
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ jobs:
- run: echo ${{ github.ref }}
- name: Create ipfs-webui.car file
run: |
ipfs dag export ${{ steps.ipfs.outputs.cid }} > build/ipfs-webui_${{ github.sha }}.car
ipfs dag export ${{ steps.ipfs.outputs.cid }} > ipfs-webui_${{ github.sha }}.car
- name: Attach produced build to Github Action
uses: actions/upload-artifact@v2
with:
name: ipfs-webui_${{ github.sha }}.car
path: build/ipfs-webui_${{ github.sha }}.car
path: ipfs-webui_${{ github.sha }}.car
if-no-files-found: error

- name: Pin to estuary.tech
Expand Down Expand Up @@ -170,7 +170,6 @@ jobs:
# 2. The 'publish-release-build.yml' workflow
release:
name: 'Run semantic release'
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [build, publishPreview, eslint, typecheck, test-e2e, test-unit]
steps:
Expand Down Expand Up @@ -214,8 +213,23 @@ jobs:
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm

- name: Download CAR artifact
uses: actions/download-artifact@v3
with:
name: ipfs-webui_${{ github.sha }}.car

- name: Dry-run semantic release
if: github.ref != 'refs/heads/main'
run: |
git config user.name "ipfs-gui-bot"
git config user.email "108953096+ipfs-gui-bot@users.noreply.github.com"
npx semantic-release --ci --dry-run -b ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

# Update the version (npm version [major|minor|patch])
- name: Run semantic release
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch'
run: |
git config user.name "ipfs-gui-bot"
git config user.email "108953096+ipfs-gui-bot@users.noreply.github.com"
Expand Down
29 changes: 17 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
"name": "ipfs-webui",
"version": "2.17.3",
"private": true,
"files": [
"src",
"public",
"@types",
"ipfs-core-types",
"docs",
"build"
],
"scripts": {
"start": "run-script-os",
"start:win32": "@powershell -Command $env:REACT_APP_GIT_REV=(git rev-parse --short HEAD); react-scripts start",
Expand Down Expand Up @@ -272,18 +280,15 @@
"tarballDir": "dist"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "build/ipfs-webui_*.car",
"name": "ipfs-webui@${nextRelease.gitTag}.car",
"label": "IPFS webui (${nextRelease.gitTag}) CAR file"
}
]
}
],
["@semantic-release/github", {
"assets": [
{
"path": "ipfs-webui_*.car",
"name": "ipfs-webui@${nextRelease.gitTag}.car",
"label": "IPFS webui (${nextRelease.gitTag}) CAR file"
}
]
}],
"@semantic-release/git"
]
},
Expand Down

0 comments on commit 9a7cfad

Please sign in to comment.