Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
Finalize Release Action
Browse files Browse the repository at this point in the history
  • Loading branch information
ouun committed May 7, 2020
1 parent ff0f88c commit 890cd64
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 85 deletions.
17 changes: 0 additions & 17 deletions .github/actions/composer/action.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/actions/release/action.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/actions/yarn/action.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .github/actions/zip/action.yml

This file was deleted.

86 changes: 77 additions & 9 deletions .github/workflows/create-release-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Release Stage Framework
name: Create Stage Release

jobs:
build:
Expand All @@ -15,14 +15,82 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

# Composer action
- uses: ./.github/actions/composer
# Get Composer cache
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
# Yarn action
- uses: ./.github/actions/yarn
# Get Composer Dependencies
- name: Get Composer Dependencies
uses: pxgamer/composer-action@master
with:
command: install --no-dev --optimize-autoloader --prefer-dist

# ZIP Release
- uses: ./.github/actions/zip
# Get yarn cache
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

# Create Release with Upload & Changelog
- uses: ./.github/actions/release
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Get & Compile Yarn packages
- name: Get Yarn and compile assets
uses: actions/setup-node@v1
with:
node-version: '12'
- run: yarn install --ignore-optional
- run: yarn build:production

# Build Release Zip
- name: ZIP Release
uses: thedoctor0/zip-release@master
with:
path: '.'
filename: 'go-on-stage.zip'
exclusions: '*.git* *.circleci* *.DS_Store* /*node_modules/* /resources/*assets/* .editorconfig .eslintrc.js .stylelintrc package.json yarn.lock webpack.mix.js tailwind.config.js'

# Read Changelog.md for Release
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/[email protected]
with:
version: ${{ github.ref }}
path: ./CHANGELOG.md

# Create GitHub Release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }} on Stage
body: ${{ steps.changelog_reader.outputs.log_entry }} # This pulls from the GET CHANGELOG ENTRY step above, referencing it's ID to get its outputs object, which include a `log_entry`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
draft: false
prerelease: true

# One ZIP upload directly to Release
- 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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./go-on-stage.zip
asset_name: stage.zip
asset_content_type: application/zip

0 comments on commit 890cd64

Please sign in to comment.