Skip to content

Workflow file for this run

name: Torrent Dorayaki Auto Build
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: '16.16.0'
- uses: actions/checkout@main
- name: install dependencies
run: npm install
- name: build
run: npm run build
- name: rm map and copy to chrome
run: |
rm -rf ./dist/js/*.map
cp -r ./dist/* ./chrome/
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v5
- name: create release.zip
run: |
cd ./dist/
zip -q -r release.zip *
cd ../chrome/
zip -q -r release.zip *
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- 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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./dist/release.zip
asset_name: release-${{ steps.branch-name.outputs.current_branch }}.zip
asset_content_type: application/zip
- name: Upload Release Asset With Chrome
id: upload-release-asset-chrome
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./chrome/release.zip
asset_name: release-${{ steps.branch-name.outputs.current_branch }}.crx
asset_content_type: application/zip