mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
build: use github actions
This commit is contained in:
parent
2dadb747f4
commit
e7c31fa050
3 changed files with 111 additions and 2 deletions
37
.github/workflows/build.yml
vendored
Normal file
37
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 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
|
||||
68
.github/workflows/release-assets.yml
vendored
Normal file
68
.github/workflows/release-assets.yml
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
name: Release assets when push tags
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v[0-9]+.* # roughly matching version numbers
|
||||
- test
|
||||
|
||||
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
|
||||
8
Makefile
8
Makefile
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue