diff --git a/.github/workflows/0.8-alphas.yml b/.github/workflows/0.8-alphas.yml new file mode 100644 index 0000000..95ff9a2 --- /dev/null +++ b/.github/workflows/0.8-alphas.yml @@ -0,0 +1,174 @@ +# Setting up a release workflow for `elfeed-score'. Much thanks to +# BurntShushi from whom I shamelessly copied a lot of this +# +name: alphas +on: + # allow this workflow to be triggered manually, which is what this + # event allegedly does + workflow_dispatch: + push: + # I can't seem to specify that this workflow should only run on branch '0.7' + # *and* on pushing a tag. + branches: + - 0.8 + +jobs: + # This job will create the GitHub release + create-release: + name: create-release + runs-on: ubuntu-latest + # Un-comment this for testing + # env: + # RELEASE_VERSION: 0.6.3 + # RELEASE_VERSION: 0.0.1 + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Get the release version from configure.ac + # We are in /home/runner/work/elfeed-score/elfeed-score + # with a full checkout + if: env.RELEASE_VERSION == '' + run: | + pwd + ls + set -x + v=`awk '/^AC_INIT/ {print substr($2, 2, length($2)-3)}' configure.ac` + a=`awk '/^AC_INIT/ {print substr($2, 6, length($2)-7)}' configure.ac` + echo "RELEASE_VERSION=${v}" >> $GITHUB_ENV + echo "ALPHA_VERSION=${a}" >> $GITHUB_ENV + echo "version is: ${{ env.RELEASE_VERSION }}" + echo "alpha version is: ${{ env.ALPHA_VERSION }}" + + - name: Create GitHub release + id: release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.RELEASE_VERSION }} + release_name: 0.8-alpha-${{ env.ALPHA_VERSION }} + prerelease: true + + - name: Save release upload URL to artifact + run: | + pwd + mkdir artifacts + ls + echo "${{ steps.release.outputs.upload_url }}" > artifacts/release-upload-url + + - name: Save version number to artifact + run: | + pwd + ls + echo "${{ env.RELEASE_VERSION }}" > artifacts/release-version + echo "${{ env.ALPHA_VERSION }}" > artifacts/alpha-version + + - name: Upload artifacts + uses: actions/upload-artifact@v1 + with: + name: artifacts + path: artifacts + + # This job will actually create the artifacts I want to include with the release + build-release: + name: build-release + needs: ['create-release'] + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Get release download URL + uses: actions/download-artifact@v1 + with: + name: artifacts + path: artifacts + + - name: Set release upload URL and release version + shell: bash + run: | + release_upload_url="$(cat artifacts/release-upload-url)" + echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV + echo "release upload url: $RELEASE_UPLOAD_URL" + release_version="$(cat artifacts/release-version)" + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + alpha_version="$(cat artifacts/alpha-version)" + echo "ALPHA_VERSION=$alpha_version" >> $GITHUB_ENV + echo "alpha version: ${{ env.ALPHA_VERSION }}" + + - name: Install tooling + shell: bash + run: | + pwd + set -x + sudo apt-get install -y autoconf automake emacs + git clone https://github.com/skeeto/elfeed.git + + # Would be nice to do a "make check" here, as well, but + # `elfeed-score-test-serde' fails, I suspect because I can't write + # to /tmp on the GitHub Actions host. + - name: Configure & roll an elfeed-score distribution tarball + shell: bash + run: | + pwd + set -x + export EMACSLOADPATH=$(pwd):$(pwd)/elfeed:$(pwd)/elfeed/tests:$(ls -d /usr/share/emacs/2*)/lisp + ls /usr/share/emacs + ./bootstrap && ./configure + make all dist + echo "DISTRO_BZ2=elfeed-score-${{ env.RELEASE_VERSION }}.tar.bz2" >> $GITHUB_ENV + echo "DISTRO_GZ=elfeed-score-${{ env.RELEASE_VERSION }}.tar.gz" >> $GITHUB_ENV + echo "DISTRO_XZ=elfeed-score-${{ env.RELEASE_VERSION }}.tar.xz" >> $GITHUB_ENV + echo "DISTRO_ZSTD=elfeed-score-${{ env.RELEASE_VERSION }}.tar.zstd" >> $GITHUB_ENV + echo "DISTRO_PKG=elfeed-score-${{ env.RELEASE_VERSION }}.tar" >> $GITHUB_ENV + + - name: Upload bzip2 tarball + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: ${{ env.DISTRO_BZ2 }} + asset_name: ${{ env.DISTRO_BZ2 }} + asset_content_type: application/octet-stream + + - name: Upload gzip tarball + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: ${{ env.DISTRO_GZ }} + asset_name: ${{ env.DISTRO_GZ }} + asset_content_type: application/octet-stream + + - name: Upload xzip tarball + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: ${{ env.DISTRO_XZ }} + asset_name: ${{ env.DISTRO_XZ }} + asset_content_type: application/octet-stream + + - name: Upload zstd tarball + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: ${{ env.DISTRO_ZSTD }} + asset_name: ${{ env.DISTRO_ZSTD }} + asset_content_type: application/octet-stream + + - name: Upload the Emacs package + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: ${{ env.DISTRO_PKG }} + asset_name: ${{ env.DISTRO_PKG }} + asset_content_type: application/octet-stream