Skip to content

Commit

Permalink
Added github action for release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpoensgen committed Feb 27, 2020
1 parent b26fe0e commit 122309b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.github export-ignore
/bin export-ignore
/src/Resources/app/storefront/package.json export-ignore
/src/Resources/app/storefront/package-lock.json export-ignore
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
push:
branches:
- master

tags:
- '*'

jobs:
build-release:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')

name: Build release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Get version
id: getVersion
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Prepare release
env:
REPOSITORY: ${{ github.event.repository.name }}
VERSION: ${{ steps.getVersion.outputs.VERSION }}
run: mkdir release && git archive --prefix ${REPOSITORY}/ ${VERSION} --format=zip > release/${REPOSITORY}-${VERSION}.zip

- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: latest
path: release
release:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
name: Publish release
needs: [build-release]
runs-on: ubuntu-latest

steps:
- name: Download release artifacts
uses: actions/download-artifact@v1
with:
name: latest

- name: Upload assets
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: latest/*
asset_name:
tag: ${{ github.ref }}
overwrite: true
file_glob: true

0 comments on commit 122309b

Please sign in to comment.