Update build?
This commit is contained in:
parent
d5bcf4a712
commit
69c7ccaf6d
1 changed files with 16 additions and 22 deletions
38
.github/workflows/build.yml
vendored
38
.github/workflows/build.yml
vendored
|
|
@ -15,28 +15,22 @@ jobs:
|
||||||
prebuild:
|
prebuild:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Create Release From Commit Hash
|
- name: Create Release
|
||||||
uses: actions/github-script@v2
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
tag_name: prerelease-$GITHUB_SHA
|
||||||
script: |
|
release_name: Prerelease from Commit $GITHUB_SHA
|
||||||
console.log(`Creating Tag with context.sha=${context.sha}`)
|
draft: false
|
||||||
await github.git.createRef({
|
prerelease: true
|
||||||
owner: context.repo.owner,
|
- name: Store Release ID
|
||||||
repo: context.repo.repo,
|
run: |
|
||||||
ref: `prerelease-${context.sha}`,
|
echo "{release_id}={steps.create_release.outputs.id}" >> $GITHUB_ENV
|
||||||
sha: context.sha
|
|
||||||
});
|
# context.sha
|
||||||
|
|
||||||
const release = await github.repos.createRelease({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
tag_name: `prerelease-${context.sha}`,
|
|
||||||
prerelease: true,
|
|
||||||
target_commitish: sha
|
|
||||||
});
|
|
||||||
|
|
||||||
process.env.release_id=release.data.id
|
|
||||||
build:
|
build:
|
||||||
needs: [prebuild]
|
needs: [prebuild]
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -70,7 +64,7 @@ jobs:
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
name: file,
|
name: file,
|
||||||
release_id: process.env.release_id,
|
release_id: ${{env.release_id}},
|
||||||
data: await fs.readFile(`./dist/${file}`)
|
data: await fs.readFile(`./dist/${file}`)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue