Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add release-please-action to release process #55

Merged
merged 1 commit into from Jan 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 24 additions & 23 deletions .github/workflows/release.yml
@@ -1,21 +1,36 @@
name: Binaryen.ml Release w/ Archive
name: Binaryen.ml Release
on:
push:
tags:
- '*'
branches:
- master

jobs:
build:
release-please:
name: Create Release
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
upload_url: ${{ steps.release.outputs.upload_url }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: ocaml
package-name: binaryen.ml
bump-minor-pre-major: true

add-archive:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
name: Add archive to release
runs-on: macos-latest
steps:
- name: Install git-archive-all
run: |
brew install git-archive-all

- uses: little-core-labs/get-git-tag@v3.0.2
id: tag_name

- name: Checkout code
uses: actions/checkout@v2
with:
Expand All @@ -25,27 +40,13 @@ jobs:
run: |
git-archive-all --force-submodules binaryen-archive.tar.gz

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.tag_name.outputs.tag }}
body: |
Changes in this Release
- FILL OUT CHANGES HERE
draft: true
prerelease: ${{ !startsWith(steps.tag_name.outputs.tag, 'v') }}

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ needs.release-please.outputs.upload_url }}
asset_path: ./binaryen-archive.tar.gz
asset_name: binaryen-archive-${{ steps.tag_name.outputs.tag }}.tar.gz
asset_name: binaryen-archive-${{ needs.release-please.outputs.tag_name }}.tar.gz
asset_content_type: application/gzip