-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from grain-lang/opam-publish-headless
Add workflow for automatic opam publish
- Loading branch information
Showing
4 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "[email protected]" | ||
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 }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
opam-version: "2.0" | ||
version: "0.3.0" | ||
synopsis: "OCaml bindings for Binaryen" | ||
maintainer: "[email protected]" | ||
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" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "binaryen.ml", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "OCaml bindings for Binaryen.", | ||
"author": "Oscar Spencer <[email protected]>", | ||
"license": "Apache-2.0", | ||
|