Skip to content

Commit

Permalink
Add release option for asset generation. (#1102)
Browse files Browse the repository at this point in the history
Co-authored-by: Drew Crampsie <[email protected]>
  • Loading branch information
ober and drewc authored Jan 23, 2024
1 parent 423deec commit c190fe6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 6 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 2 additions & 5 deletions doc/reference/dev/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit c190fe6

Please sign in to comment.