fix(manifest): automatically enable on app.koinly.io #654
Workflow file for this run
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
name: Build and upload zip | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
# Needed for ncipollo/release-action@v1 below | |
# See https://github.com/ncipollo/release-action/issues/208#issuecomment-1398625039 | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
- uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- uses: pnpm/action-setup@v2 | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm build | |
- run: pnpm build:firefox | |
- name: Prepare to build archives | |
run: | | |
mv dist/chrome rolod0x-chrome | |
mv dist/firefox rolod0x-firefox | |
if [[ ${{github.ref}} == refs/pull/* ]]; then | |
echo "Detected PR; github.ref=${{github.ref}}" | |
RELEASE_NAME="rolod0x-${{github.head_ref}}" | |
else | |
echo "Detected non-PR; github.ref=${{github.ref}}" | |
RELEASE_NAME="rolod0x-${{github.ref_name}}" | |
fi | |
RELEASE_NAME="${RELEASE_NAME//\//_}" | |
echo "RELEASE_NAME=$RELEASE_NAME" | |
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV | |
# This action creates a .zip and uploads it as an artifact | |
- name: Upload development build artifact for Chrome | |
uses: actions/upload-artifact@v4 | |
if: ${{ github.ref_type != 'tag' }} | |
with: | |
# .zip suffix gets appended automatically | |
name: "${{env.RELEASE_NAME}}-chrome" | |
# Ugly wildcard hack to include containing directory in the .zip file; | |
# this makes the .zip file structure consistent with release .zip files | |
# which are constructed below. | |
# See https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions | |
path: rolod0x-chrome* | |
# Same as above, but for Firefox | |
- name: Upload development build artifact for Firefox | |
uses: actions/upload-artifact@v4 | |
if: ${{ github.ref_type != 'tag' }} | |
with: | |
name: "${{env.RELEASE_NAME}}-firefox" | |
path: rolod0x-firefox* | |
- name: Create release zip files from version tag | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
zip -r $RELEASE_NAME-chrome.zip rolod0x-chrome/ | |
zip -r $RELEASE_NAME-firefox.zip rolod0x-firefox/ | |
- name: Create a draft release from a tag | |
uses: ncipollo/release-action@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
artifacts: "${{env.RELEASE_NAME}}-*.zip" | |
draft: true | |
generateReleaseNotes: true | |
# See also release.yml |