Skip to content

Commit 890cd64

Browse files
committed
Finalize Release Action
1 parent ff0f88c commit 890cd64

File tree

5 files changed

+77
-85
lines changed

5 files changed

+77
-85
lines changed

.github/actions/composer/action.yml

-17
This file was deleted.

.github/actions/release/action.yml

-32
This file was deleted.

.github/actions/yarn/action.yml

-20
This file was deleted.

.github/actions/zip/action.yml

-7
This file was deleted.

.github/workflows/create-release-zip.yml

+77-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
tags:
55
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
66

7-
name: Release Stage Framework
7+
name: Create Stage Release
88

99
jobs:
1010
build:
@@ -15,14 +15,82 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v2
1717

18-
# Composer action
19-
- uses: ./.github/actions/composer
18+
# Get Composer cache
19+
- name: Get Composer Cache Directory
20+
id: composer-cache
21+
run: |
22+
echo "::set-output name=dir::$(composer config cache-files-dir)"
23+
- uses: actions/cache@v1
24+
with:
25+
path: ${{ steps.composer-cache.outputs.dir }}
26+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-composer-
2029
21-
# Yarn action
22-
- uses: ./.github/actions/yarn
30+
# Get Composer Dependencies
31+
- name: Get Composer Dependencies
32+
uses: pxgamer/composer-action@master
33+
with:
34+
command: install --no-dev --optimize-autoloader --prefer-dist
2335

24-
# ZIP Release
25-
- uses: ./.github/actions/zip
36+
# Get yarn cache
37+
- name: Get yarn cache directory path
38+
id: yarn-cache-dir-path
39+
run: echo "::set-output name=dir::$(yarn cache dir)"
2640

27-
# Create Release with Upload & Changelog
28-
- uses: ./.github/actions/release
41+
- uses: actions/cache@v1
42+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
43+
with:
44+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
45+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
46+
restore-keys: |
47+
${{ runner.os }}-yarn-
48+
49+
# Get & Compile Yarn packages
50+
- name: Get Yarn and compile assets
51+
uses: actions/setup-node@v1
52+
with:
53+
node-version: '12'
54+
- run: yarn install --ignore-optional
55+
- run: yarn build:production
56+
57+
# Build Release Zip
58+
- name: ZIP Release
59+
uses: thedoctor0/zip-release@master
60+
with:
61+
path: '.'
62+
filename: 'go-on-stage.zip'
63+
exclusions: '*.git* *.circleci* *.DS_Store* /*node_modules/* /resources/*assets/* .editorconfig .eslintrc.js .stylelintrc package.json yarn.lock webpack.mix.js tailwind.config.js'
64+
65+
# Read Changelog.md for Release
66+
- name: Get Changelog Entry
67+
id: changelog_reader
68+
uses: mindsers/[email protected]
69+
with:
70+
version: ${{ github.ref }}
71+
path: ./CHANGELOG.md
72+
73+
# Create GitHub Release
74+
- name: Create Release
75+
id: create_release
76+
uses: actions/create-release@v1
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
with:
80+
tag_name: ${{ github.ref }}
81+
release_name: ${{ github.ref }} on Stage
82+
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
83+
draft: false
84+
prerelease: true
85+
86+
# One ZIP upload directly to Release
87+
- name: Upload Release Asset
88+
id: upload-release-asset
89+
uses: actions/upload-release-asset@v1
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
with:
93+
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
94+
asset_path: ./go-on-stage.zip
95+
asset_name: stage.zip
96+
asset_content_type: application/zip

0 commit comments

Comments
 (0)