changing and running the full ci script, so that it can set everythin… #45
Workflow file for this run
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
name: emscripten | |
on: | |
push: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
emscripten: | |
env: | |
EMSCRIPTEN_VERSION: 3.1.47 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install emscripten | |
working-directory: libheif | |
run: | | |
./scripts/install-ci-linux.sh | |
- name: Prepare CI | |
working-directory: libheif | |
run: | | |
./scripts/prepare-ci.sh | |
- name: Run tests | |
working-directory: libheif | |
run: | | |
./scripts/run-ci.sh | |
- name: Dist prep | |
run: ./dist-prep.sh | |
- name: WASM experimental | |
working-directory: libheif | |
run: | | |
sed s/USE_WASM=0/USR_WASM=1/g ./scripts/run-ci.sh > ./scripts/run-ci-wasm.sh | |
chmod +x ./scripts/run-ci-wasm.sh | |
./scripts/run-ci-wasm.sh | |
ls -la | |
- name: Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: libheif-dist | |
path: dist | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' | |
uses: actions/github-script@v2 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const fs = require('fs').promises; | |
console.log('environment', process.versions); | |
const { repo: { owner, repo }, sha, ref } = context; | |
console.log({ owner, repo, sha, ref }); | |
const name = ref.replace('refs/tags/', ''); | |
const release = await github.repos.createRelease({ | |
owner, repo, name, | |
tag_name: name, | |
draft: true, | |
target_commitish: sha | |
}); | |
console.log('created release', { release }); | |
for (let file of await fs.readdir('./dist')) { | |
console.log('uploading', file); | |
await github.repos.uploadReleaseAsset({ | |
owner, repo, | |
release_id: release.data.id, | |
name: file, | |
data: await fs.readFile(`./dist/${file}`) | |
}); | |
} |