Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: auto releasing ci (#146)
* feat: auto releasing ci * chore: pin major version for upload-release-asset * ci: remove duplicate install deps * docs: update readme * chore: remove deprecated release script Co-authored-by: Daan Wijns <dw.daanwijns@gmail.com>
- Loading branch information
Showing
4 changed files
with
98 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,80 @@ | ||
name: Build release | ||
on: | ||
release: | ||
types: [published, edited] | ||
|
||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Install & build | ||
uses: actions/setup-node@master | ||
- run: npm install | ||
- run: npm run build | ||
- name: Zip it | ||
uses: montudor/action-zip@v0.1.0 | ||
with: | ||
args: zip -qq -r ./release.zip ./vuetorrent | ||
- name: Get Version | ||
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV | ||
- name: Upload | ||
uses: actions/upload-release-asset@v1.0.1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./release.zip | ||
asset_name: release.zip | ||
asset_content_type: application/zip | ||
setup-release: | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
upload_url: ${{ steps.release.outputs.upload_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Run release please | ||
uses: google-github-actions/release-please-action@v2.16 | ||
id: release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: node | ||
package-name: VueTorrent | ||
upload-release: | ||
needs: setup-release | ||
if: ${{ needs.setup-release.outputs.release_created }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
- name: Build Node.js cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: ${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build VueTorrent | ||
run: npm run build | ||
- name: Zip VueTorrent | ||
run: zip -qq -r ./vuetorrent.zip ./vuetorrent | ||
- name: Upload VueTorrent release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.setup-release.outputs.upload_url }} | ||
asset_path: ./vuetorrent.zip | ||
asset_name: vuetorrent.zip | ||
asset_content_type: application/zip | ||
push-release: | ||
needs: setup-release | ||
if: ${{ needs.setup-release.outputs.release_created }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
- name: Build Node.js cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: ${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build VueTorrent | ||
run: npm run build | ||
- name: Push to latest-release | ||
uses: JamesIves/github-pages-deploy-action@3.7.1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: latest-release | ||
FOLDER: ./vuetorrent/public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
name: Test Core Components | ||
on: | ||
push | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test-core: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Cache node modules | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
- name: Build Node.js cache | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install & test | ||
uses: actions/setup-node@master | ||
- run: npm ci | ||
- run: npm run test:unit | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: ${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run tests | ||
run: npm run test:unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.