Skip to content

Commit

Permalink
perf(ci): upload compiled version to github release assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason-2020 committed Jul 7, 2020
1 parent 6fa9da6 commit 07019a1
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 19 deletions.
File renamed without changes.
20 changes: 20 additions & 0 deletions .github/workflows/ui.yaml → .github/workflows/ui.yml
Expand Up @@ -77,6 +77,26 @@ jobs:
cd ui
yarn build
- name: Prepare release assets [tag]
if: startsWith(github.ref, 'refs/tags/')
run: |
cd ui
tar -zcf ui-${GITHUB_REF#refs/tags/}.tar.gz build
- name: Get release version [tag]
id: get_release_version
if: startsWith(github.ref, 'refs/tags/')
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Upload release assets [tag]
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./ui/ui-${{ steps.get_release_version.outputs.VERSION }}.tar.gz
name: Release ${{ steps.get_release_version.outputs.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build docker image [push]
if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/apm' || github.ref == 'refs/heads/automations')
env:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/widgets.yaml → .github/workflows/widgets.yml
Expand Up @@ -63,6 +63,26 @@ jobs:
cd widgets
yarn build
- name: Prepare release assets [tag]
if: startsWith(github.ref, 'refs/tags/')
run: |
cd widgets
tar -zcf widgets-${GITHUB_REF#refs/tags/}.tar.gz dist locales static
- name: Get release version [tag]
id: get_release_version
if: startsWith(github.ref, 'refs/tags/')
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Upload release assets [tag]
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./widgets/widgets-${{ steps.get_release_version.outputs.VERSION }}.tar.gz
name: Release ${{ steps.get_release_version.outputs.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build docker image [push]
if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/apm' )
run: |
Expand All @@ -78,3 +98,4 @@ jobs:
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
docker build -t erxes/erxes-widgets:${GITHUB_REF#refs/tags/} -f Dockerfile .
docker push erxes/erxes-widgets:${GITHUB_REF#refs/tags/}
5 changes: 0 additions & 5 deletions .release-it.json
Expand Up @@ -18,10 +18,5 @@
"preset": "angular",
"infile": "CHANGELOG.md"
}
},
"hooks": {
"after:bump": "./scripts/build.sh",
"after:git:release": "echo After git push, before github release",
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
}
}
14 changes: 0 additions & 14 deletions scripts/build.sh

This file was deleted.

1 change: 1 addition & 0 deletions ui/.gitignore
@@ -0,0 +1 @@
public/version.json
1 change: 1 addition & 0 deletions ui/base.Dockerfile.dockerignore
Expand Up @@ -12,3 +12,4 @@ Dockerfile*
jest*.js
*.json
yarn.lock
*.tar.gz
1 change: 1 addition & 0 deletions ui/ui.Dockerfile.dockerignore
Expand Up @@ -14,3 +14,4 @@ jest*.js
*.json
yarn.lock
docker-entrypoint.sh
*.tar.gz

0 comments on commit 07019a1

Please sign in to comment.