Skip to content

Commit

Permalink
CI: Set up release workflow (#16)
Browse files Browse the repository at this point in the history
Draft releases are automatically generated when tagging.
  • Loading branch information
dbrgn authored May 1, 2020
1 parent 6977cc1 commit 74a34b6
Showing 1 changed file with 52 additions and 0 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 @@
on:
push:
tags:
- v*

name: Release

jobs:

release:
name: create a release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Determine release name
run: echo "::set-env name=RELEASE_FILENAME::reservation-web-${GITHUB_REF##*/}"
- run: npm install
- name: Build release bundle
run: |
cp .env.example .env && \
npm run build && \
mv public ${RELEASE_FILENAME} && \
tar cfvz ${RELEASE_FILENAME}.tar.gz ${RELEASE_FILENAME}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
body: |
Release automatically generated by GitHub workflows.
NOTE: Because the env variables are processed at build time,
you need to replace the `PLEASE_SET_API_TOKEN_VARIABLE` string
in the release build with the actual API token.
- name: Upload release assets
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 }}
asset_path: ./${{ env.RELEASE_FILENAME }}.tar.gz
asset_name: ${{ env.RELEASE_FILENAME }}.tar.gz
asset_content_type: application/gzip

0 comments on commit 74a34b6

Please sign in to comment.