summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTina Müller <cpan2@tinita.de>2020-05-29 23:07:16 +0200
committerIngy döt Net <ingy@ingy.net>2020-06-22 10:21:14 -0700
commitacd6f6f014c25e46363e718381e0b35205df2d83 (patch)
tree59c59fd0ed36780185320f9748ea3e6054887297
parent2c891fc7a770e8ba2fec34fc6b545c672beb37e6 (diff)
downloadlibyaml-git-release/test.tar.gz
Add workflow for creating release tarballsrelease/test
Also minor cleanup of .github/workflows/main.yml
-rw-r--r--.github/workflows/dist.yaml28
-rw-r--r--.github/workflows/main.yml17
-rw-r--r--.gitignore1
-rw-r--r--.makefile2
-rw-r--r--Makefile.am13
-rw-r--r--pkg/ReadMe.md77
-rw-r--r--pkg/docker/.gitignore3
-rw-r--r--pkg/docker/Dockerfile32
-rw-r--r--pkg/docker/Makefile23
-rw-r--r--pkg/docker/output/ReadMe1
-rwxr-xr-xpkg/docker/scripts/libyaml-dist.sh23
11 files changed, 200 insertions, 20 deletions
diff --git a/.github/workflows/dist.yaml b/.github/workflows/dist.yaml
new file mode 100644
index 0000000..c7ce142
--- /dev/null
+++ b/.github/workflows/dist.yaml
@@ -0,0 +1,28 @@
+name: dist
+
+on:
+ push:
+ branches: [ release/* ]
+
+jobs:
+ dist:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - run: env | sort
+
+ - name: Get image
+ run: |
+ time docker pull yamlio/libyaml-dev
+ docker images | grep libyaml
+
+ - run: |
+ make -C pkg/docker libyaml-dist-ci
+ ls -l pkg/docker/output
+
+ - uses: actions/upload-artifact@v2
+ with:
+ name: release
+ path: pkg/docker/output/yaml-0*
+
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index c2bdef4..e8ec497 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -10,6 +10,8 @@ jobs:
build:
+ env:
+ CC: ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
@@ -25,12 +27,11 @@ jobs:
- run: env | sort
- name: Install software
+ if: ${{ matrix.os == 'macOS-latest' }}
run: |
- if [[ '${{ matrix.os }}' == macOS-latest ]]; then
- brew install automake bash coreutils make
- echo ::add-path::/usr/local/opt/coreutils/libexec/gnubin
- echo ::add-path::/usr/local/opt/make/libexec/gnubin
- fi
+ brew install automake bash coreutils make
+ echo ::add-path::/usr/local/opt/coreutils/libexec/gnubin
+ echo ::add-path::/usr/local/opt/make/libexec/gnubin
- name: Fetch branches
run: |
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
@@ -48,12 +49,6 @@ jobs:
- name: Compiler version
run: ${{ matrix.compiler }} --version
- env:
- CC: ${{ matrix.compiler }}
- run: cmake .
- env:
- CC: ${{ matrix.compiler }}
- run: make
- env:
- CC: ${{ matrix.compiler }}
- run: make test
diff --git a/.gitignore b/.gitignore
index 90840c8..8257f57 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,7 +28,6 @@ config.h*
/configure
stamp-h1
!config/config.h.in
-/packaging/
/tests/run-dumper
/tests/run-emitter
/tests/run-emitter-test-suite
diff --git a/.makefile b/.makefile
index 9d526a4..7d6e572 100644
--- a/.makefile
+++ b/.makefile
@@ -23,6 +23,8 @@ MAKE_TARGETS := \
all \
all-am \
all-recursive \
+ docker-build \
+ docker-dist \
install \
test \
test-all \
diff --git a/Makefile.am b/Makefile.am
index 551c740..45d9c27 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,7 @@ maintainer-clean-local:
-find ${builddir} -name Makefile.in -exec rm -f '{}' ';'
distclean-local:
- rm -fr tests/run-test-suite packaging
+ rm -fr tests/run-test-suite
-git worktree prune
.PHONY: bootstrap
@@ -43,12 +43,9 @@ ifeq ($(LIBYAML_TEST_SUITE_RUN_REPO),$(LIBYAML_TEST_SUITE_RUN_REPO_DEFAULT))
git clone --branch $(LIBYAML_TEST_SUITE_RUN_BRANCH) $(LIBYAML_TEST_SUITE_RUN_REPO) $@
endif
-packaging:
- -git branch --track $@ origin/$@
- git worktree add --force $@ $@
+docker-build:
+ make -C pkg/docker build
-docker-dist: packaging
- make -C $</docker libyaml-dist
+docker-dist:
+ make -C pkg/docker libyaml-dist
-docker-test-pyyaml: packaging
- make -C $</docker test-pyyaml
diff --git a/pkg/ReadMe.md b/pkg/ReadMe.md
new file mode 100644
index 0000000..7faede8
--- /dev/null
+++ b/pkg/ReadMe.md
@@ -0,0 +1,77 @@
+# How to Make a `libyaml` Release
+
+## Versioning
+
+Update libyaml version in:
+* announcement.msg
+* Changes
+* CMakeLists.txt
+ * `YAML_VERSION_MAJOR`, `YAML_VERSION_MINOR`, `YAML_VERSION_PATCH`
+* .appveyor.yml
+* configure.ac
+ * `YAML_MAJOR`, `YAML_MINOR`, `YAML_PATCH`, `YAML_RELEASE`, `YAML_CURRENT`, `YAML_REVISION`
+
+Commit and push everything to `release/0.x.y`.
+
+## Test and Create Release Archives
+
+### GitHub Actions Automation
+
+The github workflow:
+
+ .github/workflows/dist.yaml
+
+will do this automatically for you.
+
+#### .github/workflows/dist.yaml
+
+This workflow will create release archives (`tar.gz` and `zip`).
+
+### Manually
+
+Make sure you have a clean git repository (no changed files).
+The following process will clone your current git directory.
+
+This will need the docker image `yamlio/libyaml-dev`.
+You can either pull it, or create it yourself:
+
+ make docker-build
+
+### Create dist archives
+
+Run:
+
+ make docker-dist
+
+It will run `make dist` in the container to create a tarball written to
+`pkg/docker/output`.
+It will also create a zipfile.
+
+## Update master
+
+ git merge release/0.x.y
+ git tag -a 0.x.y
+ # <Editor opens>
+ # Paste the corresponding entry from the Changes file
+ # Look at an earlier release for how it should look like:
+ # git show 0.2.3
+ git push origin master 0.x.y
+
+## Create a GitHub release
+
+Go to "Releases" and click on "Draft a new release".
+
+Fill in the tag you just created in the previous step.
+
+Fill in the release title: v0.x.y
+
+Paste the changelog into the description field.
+
+Upload the tar.gz and .zip file.
+
+You can "Save draft" and publish later, or directly click on "Publish release".
+
+## Update pyyaml.org
+
+See <https://github.com/yaml/pyyaml.org/blob/master/ReadMe.md>.
+
diff --git a/pkg/docker/.gitignore b/pkg/docker/.gitignore
new file mode 100644
index 0000000..f5b0d6d
--- /dev/null
+++ b/pkg/docker/.gitignore
@@ -0,0 +1,3 @@
+output/*
+!Makefile
+!output/ReadMe
diff --git a/pkg/docker/Dockerfile b/pkg/docker/Dockerfile
new file mode 100644
index 0000000..71f9df1
--- /dev/null
+++ b/pkg/docker/Dockerfile
@@ -0,0 +1,32 @@
+FROM ubuntu:18.04
+
+RUN apt-get update \
+ && apt-get install -y \
+ automake \
+ bison \
+ build-essential \
+ cmake \
+ curl \
+ doxygen \
+ flex \
+ git \
+ less \
+ libtool \
+ python \
+ vim \
+ zip \
+ && true
+
+# http://www.doxygen.nl/manual/install.html
+
+RUN curl https://sourceforge.net/projects/doxygen/files/rel-1.8.14/doxygen-1.8.14.src.tar.gz/download \
+ -L -o /doxygen-1.8.14.src.tar.gz \
+ && cd / \
+ && tar -xvf doxygen-1.8.14.src.tar.gz \
+ && cd doxygen-1.8.14 \
+ && mkdir build \
+ && cd build \
+ && cmake -G "Unix Makefiles" .. \
+ && make \
+ && make install \
+ && true
diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile
new file mode 100644
index 0000000..8a53ed3
--- /dev/null
+++ b/pkg/docker/Makefile
@@ -0,0 +1,23 @@
+DOCKER_IMAGE ?= yamlio/libyaml-dev
+
+build:
+ docker build -t $(DOCKER_IMAGE) .
+
+run: build
+ docker run -it --rm $(DOCKER_IMAGE) bash
+
+prepare-git:
+ rm -rf output/libyaml.git
+ git clone ../../.git output/libyaml.git
+
+libyaml-dist: libyaml-dist-ci
+
+libyaml-dist-ci: prepare-git
+ docker run --rm -u $$(id -u) \
+ -v"$$PWD/output:/output" \
+ -v"$$PWD/scripts:/scripts" \
+ $(DOCKER_IMAGE) /scripts/libyaml-dist.sh
+
+clean:
+ rm -rf output/libyaml.git
+ rm -rf output/yaml-*.*
diff --git a/pkg/docker/output/ReadMe b/pkg/docker/output/ReadMe
new file mode 100644
index 0000000..acdc333
--- /dev/null
+++ b/pkg/docker/output/ReadMe
@@ -0,0 +1 @@
+Output directory for build files created by docker
diff --git a/pkg/docker/scripts/libyaml-dist.sh b/pkg/docker/scripts/libyaml-dist.sh
new file mode 100755
index 0000000..94e7696
--- /dev/null
+++ b/pkg/docker/scripts/libyaml-dist.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+set -ex
+
+cp -r /output/libyaml.git /tmp/
+cd /tmp/libyaml.git
+./bootstrap
+./configure
+make dist
+
+# get the tarball filename
+tarballs=(yaml-*.tar.gz)
+tarball=${tarballs[0]:?}
+dirname=${tarball/.tar.gz/}
+
+# Copy to output dir
+cp "$tarball" /output
+
+# Create zip archive
+cd /tmp
+cp "/output/$tarball" .
+tar xvf "$tarball"
+zip -r "/output/$dirname.zip" "$dirname"