-
Notifications
You must be signed in to change notification settings - Fork 10
49 lines (44 loc) · 1.75 KB
/
automated_release_and_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Automated release and build of project
on:
push:
branches:
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: nelonoel/branch-name@v1.0.1
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # Runs bundle install and caches gems. See the ruby_test.yml
# example if you need more control over bundler.
- name: Export node version
id: node_version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.node_version.outputs.NODE_VERSION }}
- name: Set release tag
# On the develop branch this might create RELEASE_VERSION=2.4.6-987654321-develop
# On the master branch this would then only create RELEASE_VERSION=2.4.6
run: echo "RELEASE_VERSION=$(printf -- '%s%s\n' $(cat .release-version) $([ ${BRANCH_NAME} = "develop" ] && printf -- '-%s-develop' ${GITHUB_RUN_ID} || echo ""))" >> $GITHUB_ENV
- name: Set up environment
run: |
cp config/database.yml.example config/database.yml
cp config/secrets.yml.example config/secrets.yml
cp config/bunny.yml.example config/bunny.yml
- name: Compile Build
run: ./compile-build
- name: Create release and upload release.tar.gz
uses: ncipollo/release-action@v1.8.8
with:
name: ${{ env.RELEASE_VERSION }}
tag: v${{ env.RELEASE_VERSION }}
prerelease: ${{ !(github.ref == 'refs/heads/master') }}
commit: ${{ github.sha }}
artifacts: release.tar.gz
artifactErrorsFailBuild: true