diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6dcbd5d70..1f6ad78e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -248,16 +248,6 @@ jobs: - run: yarn build env: EMSCRIPTEN: ${{ env.EMSDK }}/upstream/emscripten - - if: ${{ matrix.node-version == '16.x' }} - uses: actions/upload-artifact@v3 - with: - name: javascript-artifact - path: | - ./bindings/javascript/CHANGELOG.md - ./bindings/javascript/LICENSE - ./bindings/javascript/package.json - ./bindings/javascript/README.md - ./bindings/javascript/dist/ - name: ๐Ÿงช test bindings node-${{ matrix.node-version }} run: yarn test - name: ๐Ÿ” check crypto with node-${{ matrix.node-version }} @@ -325,6 +315,41 @@ jobs: awk '/Published release/ { printf("version=v%s\n",$8) }' semantic-release.log >> $GITHUB_OUTPUT fi + js-build-release: + name: ๐Ÿฏ js build release + needs: [semantic-release] + if: ${{ needs.semantic-release.outputs.release == 'True' }} + runs-on: ubuntu-latest + env: + EM_VERSION: 3.1.26 + defaults: + run: + working-directory: bindings/javascript + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - uses: mymindstorm/setup-emsdk@v12 + with: + version: ${{ env.EM_VERSION }} + - run: sudo apt-get update; sudo apt-get install zsh meson ninja-build + - run: yarn + - run: yarn build + env: + EMSCRIPTEN: ${{ env.EMSDK }}/upstream/emscripten + - uses: actions/upload-artifact@v3 + with: + name: javascript-artifact + path: | + ./bindings/javascript/CHANGELOG.md + ./bindings/javascript/LICENSE + ./bindings/javascript/package.json + ./bindings/javascript/README.md + ./bindings/javascript/dist/ + python-build-check: name: ๐Ÿ Python build & checks needs: [semantic-release] @@ -461,45 +486,6 @@ jobs: with: path: ./bindings/python3/dist/*.tar.gz - npm-release: - name: ๐Ÿ“ฆ npm release - runs-on: ubuntu-latest - needs: [semantic-release] - if: ${{ needs.semantic-release.outputs.release == 'True' }} - steps: - - uses: actions/checkout@v3 - with: - ref: master - fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: 16.x - registry-url: 'https://registry.npmjs.org' - - uses: actions/download-artifact@v3 - with: - name: javascript-artifact - path: . - - run: | - version=$(git describe --tags --abbrev=0) - yarn version --new-version ${version:1} --no-git-tag-version - - run: npm publish . --tag latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - pypi-release: - name: ๐Ÿ“ฆ PyPI release - needs: [python-build-check, python-build-check-armv7, python-sdist] - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v3 - with: - name: artifact - path: dist - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - build-release-on-ubuntu: name: ๐Ÿง Binary builds on Ubuntu runs-on: ubuntu-latest @@ -576,9 +562,47 @@ jobs: src/zenroom.command src/zencode-exec.command + npm-release: + name: ๐Ÿ“ฆ npm release + runs-on: ubuntu-latest + needs: [js-build-release, python-build-check, python-build-check-armv7, python-sdist, build-release-on-osx, build-release-on-ubuntu] + steps: + - uses: actions/checkout@v3 + with: + ref: master + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + registry-url: 'https://registry.npmjs.org' + - uses: actions/download-artifact@v3 + with: + name: javascript-artifact + path: . + - run: | + version=$(git describe --tags --abbrev=0) + yarn version --new-version ${version:1} --no-git-tag-version + - run: npm publish . --tag latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + pypi-release: + name: ๐Ÿ“ฆ PyPI release + needs: [js-build-release, python-build-check, python-build-check-armv7, python-sdist, build-release-on-osx, build-release-on-ubuntu] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + draft-binary-release: name: ๐Ÿ“ฆ Pack release - needs: [semantic-release, build-release-on-ubuntu] + needs: [semantic-release, js-build-release, python-build-check, python-build-check-armv7, python-sdist, build-release-on-osx, build-release-on-ubuntu] runs-on: ubuntu-latest steps: - name: download binary artifacts @@ -600,3 +624,21 @@ jobs: prerelease: false fail_on_unmatched_files: true generate_release_notes: true + + remove-tag-on-fail: + name: ๐Ÿงป Remove tag on fail + needs: [semantic-release, js-build-release, python-build-check, python-build-check-armv7, python-sdist, build-release-on-osx, build-release-on-ubuntu] + runs-on: ubuntu-latest + if: ${{ (failure() || cancelled()) && needs.semantic-release.outputs.release == 'True' }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Remove tag + uses: dev-drprasad/delete-tag-and-release@v1.0 + with: + tag_name: ${{ needs.semantic-release.outputs.version }} + github_token: ${{ secrets.GITHUB_TOKEN }} + delete_release: false + repo: dyne/zenroom