2021-10-06 12:43:18 -07:00
|
|
|
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 👋
|
2022-10-04 18:31:50 -07:00
|
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
2021-10-06 12:43:18 -07:00
|
|
|
- name: Get release ⬇️
|
|
|
|
id: get_release
|
2022-09-13 23:25:14 -07:00
|
|
|
uses: bruceadams/get-release@3a8733307b85cd96d52772b037617bd63d99522e
|
2021-10-06 12:43:18 -07:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
- name: Update Template ✍️
|
|
|
|
run: |
|
|
|
|
$version = $env:GITHUB_REF.TrimStart("refs/tags/v")
|
|
|
|
./build.ps1 -Version $version
|
|
|
|
- name: Upload artifacts 🆙
|
2022-10-02 18:56:46 -07:00
|
|
|
uses: actions/github-script@7dff1a87643417cf3b95bb10b29f4c4bc60d8ebd
|
2021-10-06 12:43:18 -07:00
|
|
|
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}`)
|
|
|
|
});
|
|
|
|
}
|