diff --git a/.github/workflows/opam-publish.yml b/.github/workflows/opam-publish.yml new file mode 100644 index 00000000..593b532f --- /dev/null +++ b/.github/workflows/opam-publish.yml @@ -0,0 +1,62 @@ +name: Binaryen.ml - publish to opam +on: + release: + types: [released] + +jobs: + build: + name: Publish to opam + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + ocaml-version: [4.10.0] + + steps: + - name: Checkout project + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - 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 git://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/grain-lang/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 + + # This is the only way to make opam publish "headless" currently + - name: Remove xdg-open + run: | + sudo rm $(which xdg-open) + + - name: Generate CHANGES file + run: | + echo -n "${{ github.event.release.body }}" > CHANGES.md + + - name: Setup OCaml ${{ matrix.ocaml-version }} + uses: avsm/setup-ocaml@v1 + with: + ocaml-version: ${{ matrix.ocaml-version }} + + - name: Install local dependencies + run: | + opam install opam-publish + + - name: Publish to opam + run: | + opam publish --msg-file=CHANGES.md ${{ github.event.release.assets[0].browser_download_url }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68bf8193..1d66279c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,8 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + with: + submodules: 'recursive' - name: Build archive run: | diff --git a/binaryen.opam b/binaryen.opam index 3537b8f8..a30c761d 100644 --- a/binaryen.opam +++ b/binaryen.opam @@ -1,7 +1,9 @@ opam-version: "2.0" +version: "0.3.0" synopsis: "OCaml bindings for Binaryen" maintainer: "oscar@grain-lang.org" author: "Oscar Spencer" +license: " Apache-2.0" homepage: "https://github.com/grain-lang/binaryen.ml" dev-repo: "git+https://github.com/grain-lang/binaryen.ml.git" bug-reports: "https://github.com/grain-lang/binaryen.ml/issues" diff --git a/package.json b/package.json index e7e1df3c..3b3b5020 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "binaryen.ml", - "version": "0.2.2", + "version": "0.3.0", "description": "OCaml bindings for Binaryen.", "author": "Oscar Spencer ", "license": "Apache-2.0",