From 20336f658bbc2335e8142a5a560f54f7370db126 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Sun, 30 Aug 2020 15:36:51 -0700 Subject: [PATCH 1/2] Add or bump versions to manifests --- binaryen.opam | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/binaryen.opam b/binaryen.opam index 3537b8f..a30c761 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 e7e1df3..3b3b502 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", From e2fb4dafa5cf90757c6183409ca04edc76d84db1 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Sat, 29 Aug 2020 20:43:55 -0700 Subject: [PATCH 2/2] Set up opam publish workflow --- .github/workflows/opam-publish.yml | 62 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 2 + 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/opam-publish.yml diff --git a/.github/workflows/opam-publish.yml b/.github/workflows/opam-publish.yml new file mode 100644 index 0000000..593b532 --- /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 68bf819..1d66279 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: |