Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
blenderskool committed Nov 19, 2020
1 parent 81055e3 commit ecc1433
Showing 1 changed file with 43 additions and 13 deletions.
56 changes: 43 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@ on:
name: Create Release

jobs:
build:
release:
name: Create Release
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
browser: [chrome, firefox]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -27,24 +21,60 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Output Release URL file
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt

build:
name: Create Release
needs: [release]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
browser: [chrome, firefox]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Get Release File Name & Upload URL
id: get_release_info
run: |
echo ::set-output name=file_name::${REPOSITORY_NAME##*/}-${TAG_REF_NAME##*/v}
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
env:
TAG_REF_NAME: ${{ github.ref }}
REPOSITORY_NAME: ${{ github.repository }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: BROWSER_ENV=${{ matrix.browser }} npm run build
- name: Set env
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
- run: mv dist untab-${{ env.RELEASE_VERSION }}-${{ matrix.browser }} && zip -r untab-${{ env.RELEASE_VERSION }}-${{ matrix.browser }}.zip untab-${{ env.RELEASE_VERSION }}-${{ matrix.browser }} /*
- name: Set output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- run: mv dist untab-${{ steps.vars.outputs.tag }}-${{ matrix.browser }} && zip -r untab-${{ steps.vars.outputs.tag }}-${{ matrix.browser }}.zip untab-${{ steps.vars.outputs.tag }}-${{ matrix.browser }}/*

- 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: ./untab-${{ env.RELEASE_VERSION }}-${{ matrix.browser }}.zip
asset_name: untab-${{ env.RELEASE_VERSION }}-${{ matrix.browser }}.zip
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./untab-${{ steps.vars.outputs.tag }}-${{ matrix.browser }}.zip
asset_name: untab-${{ steps.vars.outputs.tag }}-${{ matrix.browser }}.zip
asset_content_type: application/zip


0 comments on commit ecc1433

Please sign in to comment.