oh-my-posh/.github/workflows/scoop.yml
dependabot[bot] 17181f3bef chore(deps): bump actions/github-script from 6.2.0 to 6.3.0
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](c713e510db...d4560e1570)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-27 06:33:09 +02:00

47 lines
1.4 KiB
YAML

name: Scoop
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
working-directory: ${{ github.workspace }}/packages/scoop
steps:
- name: Checkout code 👋
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Get release ⬇️
id: get_release
uses: bruceadams/get-release@3a8733307b85cd96d52772b037617bd63d99522e
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Update Template ✍️
run: |
$version = $env:GITHUB_REF.TrimStart("refs/tags/v")
./build.ps1 -Version $version
- name: Upload artifacts 🆙
uses: actions/github-script@d4560e157075e2d93aa3022b5b51a42a880f1f93
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
console.log('environment', process.versions);
const fs = require('fs').promises;
const { repo: { owner, repo }, sha } = context;
console.log({ owner, repo, sha });
for (let file of await fs.readdir('./packages/scoop/dist')) {
console.log('uploading', file);
await github.rest.repos.uploadReleaseAsset({
owner, repo,
release_id: ${{ steps.get_release.outputs.id }},
name: file,
data: await fs.readFile(`./packages/scoop/dist/${file}`)
});
}