Merge branch 'build/github-actions' into develop

This commit is contained in:
EnixCoda 2020-04-08 16:24:14 +08:00
commit 0839eb5cc7
No known key found for this signature in database
GPG key ID: FE06F5DFC1C9B8E4
5 changed files with 114 additions and 4 deletions

40
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,40 @@
name: Build
on:
push:
branches-ignore:
- do-not-build
pull_request:
branches-ignore:
- do-not-build
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache deps
uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Retrieve vscode icons
uses: actions/checkout@v2
with:
repository: 'vscode-icons/vscode-icons'
path: 'vscode-icons'
- name: Build
run: |
yarn
make build

67
.github/workflows/release-assets.yml vendored Normal file
View file

@ -0,0 +1,67 @@
name: Release assets when push tags
on:
push:
tags:
- v[0-9]+.* # roughly matching version numbers
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Get the ref
id: get_ref
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- uses: actions/checkout@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache deps
uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Retrieve vscode icons
uses: actions/checkout@v2
with:
repository: 'vscode-icons/vscode-icons'
path: 'vscode-icons'
- name: Build
run: |
yarn
make build
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_ref.outputs.VERSION }}
release_name: ${{ steps.get_ref.outputs.VERSION }}
draft: false
prerelease: false
- name: Generate release zip
run: |
make compress
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/Gitako.zip
asset_name: Gitako.zip
asset_content_type: application/zip

View file

@ -14,13 +14,17 @@ upload-for-analytics:
yarn sentry-cli releases finalize "$(FULL_VERSION)"
compress:
rm -f dist/gitako.zip
cd dist && zip -r gitako-$(FULL_VERSION).zip * -x *.map -x *.DS_Store
rm -f dist/Gitako.zip
cd dist && zip -r Gitako.zip * -x *.map -x *.DS_Store
rename-compressed:
cd dist && mv Gitako.zip Gitako-$(FULL_VERSION).zip
release:
$(MAKE) build
$(MAKE) upload-for-analytics
$(MAKE) compress
$(MAKE) rename-compressed
$(MAKE) compress-source
compress-source:

View file

@ -57,7 +57,6 @@
"dotenv-webpack": "^1.7.0",
"file-loader": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^0.5.2",
"fsevents": "^1.2.4",
"json-loader": "^0.5.7",
"mini-css-extract-plugin": "^0.9.0",
"raw-loader": "^4.0.0",

View file

@ -4512,7 +4512,7 @@ fsevents@2.0.7:
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.0.7.tgz#382c9b443c6cbac4c57187cdda23aa3bf1ccfc2a"
integrity sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==
fsevents@^1.2.4, fsevents@^1.2.7:
fsevents@^1.2.7:
version "1.2.9"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f"
integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==