Skip to content

feat!: Update to libbinaryen v114 (#198) #128

feat!: Update to libbinaryen v114 (#198)

feat!: Update to libbinaryen v114 (#198) #128

Workflow file for this run

name: Release
on:
push:
branches:
- master
jobs:
release-please:
name: Create Release
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v3.7.10
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: ocaml
package-name: binaryen.ml
pull-request-title-pattern: "chore${scope}: Release${component} ${version}"
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
add-archive:
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created }}
name: Add archive to release
runs-on: macos-latest
outputs:
browser_download_url: ${{ steps.upload.outputs.browser_download_url }}
notes: ${{ steps.upload.outputs.notes }}
steps:
- name: Install git-archive-all
run: |
brew install git-archive-all
- name: Checkout code
uses: actions/checkout@v3.5.3
with:
submodules: "recursive"
- name: Build archive
run: |
git-archive-all --force-submodules binaryen-archive.tar.gz
- name: Upload Release Asset
id: upload
uses: grain-lang/upload-release-action@v3.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
file: ./binaryen-archive.tar.gz
asset_name: binaryen-archive-${{ needs.release-please.outputs.tag_name }}.tar.gz
tag: ${{ needs.release-please.outputs.tag_name }}
opam-release:
needs: [release-please, add-archive]
name: Publish to opam registry
runs-on: ubuntu-latest
steps:
- name: Setup bot user
run: |
git config --global user.email "bot@grain-lang.org"
git config --global user.name "Grain Bot"
# Some hacks to make sure opam doesn't pull the repo in a way we can't deal with
- name: Setup opam repository
run: |
mkdir -p ~/.opam/plugins/opam-publish/repos/
git clone https://github.com/ocaml/opam-repository ~/.opam/plugins/opam-publish/repos/ocaml%opam-repository
cd ~/.opam/plugins/opam-publish/repos/ocaml%opam-repository
git remote add user https://${{ secrets.OPAM_RELEASE }}@github.com/grainbot/opam-repository
# Set up our token because opam doesn't support env var tokens
- name: Setup token
run: |
mkdir -p ~/.opam/plugins/opam-publish/
echo -n ${{ secrets.OPAM_RELEASE }} > ~/.opam/plugins/opam-publish/binaryen.token
- name: Generate CHANGES file
env:
CHANGES: ${{ needs.add-archive.outputs.notes }}
run: |
echo -n "$CHANGES" > CHANGES.md
- name: Setup OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.14.0
# Version 2.1.0 of opam-publish doesn't respect OPAMYES=1
# Ref https://github.com/ocaml-opam/opam-publish/issues/132#issuecomment-963616802
- name: Install publish utils
run: |
opam install opam-publish=2.0.3
- name: Publish to opam
run: |
opam publish --no-browser --msg-file=CHANGES.md ${{ needs.add-archive.outputs.browser_download_url }}
npm-release:
needs: [add-archive]
name: Publish to npm registry
runs-on: ubuntu-latest
steps:
- name: Setup NodeJS
uses: actions/setup-node@v3.6.0
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"
- name: Publish to npm
run: npm publish ${{ needs.add-archive.outputs.browser_download_url }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE }}