forked from ruigouveiamaciel/gdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Phoebe
authored and
Phoebe
committed
Feb 11, 2024
1 parent
4eee6e9
commit 5d7c7dc
Showing
4 changed files
with
108 additions
and
1,185 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
IS_COOL: true | ||
|
||
jobs: | ||
build: | ||
name: Create a new release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
|
||
- name: Build parser standalone JS | ||
working-directory: ./parser | ||
run: deno task bundle | ||
|
||
- name: Build parser binaries | ||
working-directory: ./parser | ||
run: deno task release:all | ||
|
||
- name: Copy files to release | ||
run: | | ||
mkdir -p release | ||
cp -r parser/build/* release/ | ||
- name: Build docs with Deno | ||
working-directory: ./docs | ||
run: deno task build | ||
|
||
- name: Zip dist folder | ||
working-directory: ./docs/dist | ||
run: zip -r ../../release/docs.zip * | ||
|
||
- name: Create Release | ||
uses: actions/github-script@v2 | ||
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 }); | ||
const release = await github.repos.createRelease({ | ||
owner, repo, | ||
tag_name: process.env.GITHUB_REF, | ||
draft: true, | ||
target_commitish: sha | ||
}); | ||
console.log('created release', { release }); | ||
const releaseFiles = await fs.readdir('./release'); | ||
for (let file of releaseFiles) { | ||
// do whatever filtering you want here, I'm just uploading all the files | ||
console.log('uploading', file); | ||
await github.repos.uploadReleaseAsset({ | ||
owner, repo, | ||
release_id: release.data.id, | ||
name: file, | ||
data: await fs.readFile(`./release/${file}`) | ||
}); | ||
} | ||
# - name: Create Release | ||
# id: create_release | ||
# uses: actions/create-release@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # provided by Actions, no need to create | ||
# with: | ||
# tag_name: ${{ github.ref }} | ||
# release_name: Release ${{ github.ref }} | ||
# body: Release of version ${{ github.ref }}. # TODO: generate from CHANGELOG.md file ? | ||
# draft: false | ||
# prerelease: false | ||
|
||
# - name: Upload Release Asset | ||
# id: upload-release-asset | ||
# uses: actions/upload-release-asset@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# upload_url: ${{ steps.create_release.outputs.upload_url }} # more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
# asset_path: ./release | ||
# asset_name: parser* | ||
# asset_content_type: application/zip | ||
# asset_content_type: application/octet-stream |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,6 @@ builder/src/parsed.json | |
|
||
# build deno files | ||
*.exe | ||
*.bin | ||
*.bin | ||
|
||
docs/dist/ |
Oops, something went wrong.