Skip to content

Commit

Permalink
ci: Add release-please-action to release process (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jan 12, 2021
1 parent 2096a3c commit 5909560
Showing 1 changed file with 24 additions and 23 deletions.
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

0 comments on commit 5909560

Please sign in to comment.