From c190fe6caebae15f5dd105d7ecb7455d262f888d Mon Sep 17 00:00:00 2001 From: Jaime Fournier Date: Mon, 22 Jan 2024 22:05:02 -0700 Subject: [PATCH] Add release option for asset generation. (#1102) Co-authored-by: Drew Crampsie --- .github/workflows/Release.yml | 52 +++++++++++++++++++++++++++++++++++ doc/reference/dev/release.md | 7 ++--- docker/Makefile | 2 +- 3 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/Release.yml diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 000000000..2182cc6ef --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,52 @@ +name: release + +on: + release: + types: [published] + +jobs: + build_release: + name: build_release + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: print out github context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: list all github action env vars + run: env + - name: build artifacts + run: make -C docker BRANCH=${{ github.event.release.tag_name }} fedora ubuntu package-tgz package-fedora package-ubuntu + - name: upload fedora artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: gerbil-${{ github.event.release.tag_name }}.fedora-1.0-1.x86_64.rpm + asset_name: gerbil-${{ github.event.release.tag_name }}.fedora-1.0-1.x86_64.rpm + asset_content_type: application/zip + + - name: upload ubuntu artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: gerbil-${{ github.event.release.tag_name }}.ubuntu-1.0_amd64.deb + asset_name: gerbil-${{ github.event.release.tag_name }}.ubuntu_1.0_amd64.deb + asset_content_type: application/zip + + - name: upload tgz + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: gerbil-${{ github.event.release.tag_name }}.x86_64.tgz + asset_name: gerbil-${{ github.event.release.tag_name }}.x86_64.tgz + asset_content_type: application/zip diff --git a/doc/reference/dev/release.md b/doc/reference/dev/release.md index d394fd5e2..2a1cb18b6 100644 --- a/doc/reference/dev/release.md +++ b/doc/reference/dev/release.md @@ -61,11 +61,8 @@ that you can pull in your local repository with: `git pull --tags` - Generate tarball for the Gerbil source code, *including the Gambit submodule at the correct version* in `src/gambit`. Mind that the tarball autogenerated by GitHub does not include Gambit. -- Generate a binary tarball for Linux x86-64. - ask @fare or @ober for help -- Generate a binary tarball for the shared objects that the above uses (e.g. `sqlite.so`), - so that e.g. the previous tarball can be deployed on Heroku. - ask @fare for help -- Generate rpm and deb packages for Linux x86-64. - ask @ober for help -- Publish each of these tarballs as artifacts on GitHub on the +- We automatically generate a binary tarball, Fedora rpm, and Ubuntu deb file for Linux x86_64. +- Assets are auto-published to the artifacts page on Github [release page](https://github.com/mighty-gerbils/gerbil/releases/) ## Merge Post-Release PRs diff --git a/docker/Makefile b/docker/Makefile index 05a0c3c6a..82847d092 100755 --- a/docker/Makefile +++ b/docker/Makefile @@ -232,7 +232,7 @@ package-ubuntu: package-tgz: docker run -v $(PWD):/src:z -t gerbil/ubuntu:$(arch)-$(BRANCH) \ - bash -c "tar -czvf /src/gerbil.tgz /opt/gerbil" + bash -c "tar -czvf /src/gerbil-$(BRANCH).$(arch).tgz /opt/gerbil" package-fedora: docker run -v $(PWD):/src:z -t gerbil/fedora:$(arch)-$(BRANCH) \