Skip to content

Upload asset to release #10

Upload asset to release

Upload asset to release #10

Workflow file for this run

name: main
on:
push:
branches:
- main
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y jq
- id: manifest-version
run: echo "version=$(jq -r '.version' src/manifest.json)" >> "$GITHUB_OUTPUT"
- run: zip -r "minimal-grey-chrome.${{ steps.manifest-version.outputs.version }}.zip" src
- run: |
git config user.name "GitHub Actions"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- run: git tag -a "${{ steps.manifest-version.outputs.version }}" -m "${{ steps.manifest-version.outputs.version }}"
- run: git push --follow-tags
- uses: actions/github-script@v6
env:
MANIFEST_VERSION: ${{ steps.manifest-version.outputs.version }}
with:
script: |
const fs = require('fs').promises;
const filePath = `minimal-grey-chrome.${process.env.MANIFEST_VERSION}.zip`
const release = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: process.env.MANIFEST_VERSION,
name: process.env.MANIFEST_VERSION
})
github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.data.id,
name: filePath,
data: await fs.readFile(filePath),
});