Skip to content

Commit fbde13a

Browse files
committed
Update workflows
1 parent e3c8659 commit fbde13a

File tree

2 files changed

+73
-2
lines changed

2 files changed

+73
-2
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: CI
1+
name: Build
22

33
on: [push]
4+
45
jobs:
56
build:
67
runs-on: ubuntu-latest
@@ -28,6 +29,16 @@ jobs:
2829
- name: Build
2930
run: |
3031
mkdir dist
31-
stack --no-terminal build --test --no-run-tests
32+
stack --no-terminal build --test --no-run-tests --copy-bins --local-bin-path dist
3233
- name: Test
3334
run: stack --no-terminal build --test
35+
- name: Zip
36+
run: |
37+
cd dist
38+
tar czvf vcr-proxy-linux.tar.gz vcr-proxy
39+
- name: Archive production artifacts
40+
uses: actions/upload-artifact@v2
41+
with:
42+
name: vcr-proxy-linux.tar.gz
43+
path: |
44+
dist/vcr-proxy-linux.tar.gz

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: haskell/actions/setup@v1
13+
with:
14+
ghc-version: '8.6.3'
15+
enable-stack: true
16+
stack-version: 'latest'
17+
- name: Cache
18+
uses: actions/cache@v1
19+
env:
20+
cache-name: cache-stack
21+
with:
22+
path: ~/.stack
23+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }}
24+
restore-keys: |
25+
${{ runner.os }}-build-${{ env.cache-name }}-
26+
${{ runner.os }}-build-
27+
${{ runner.os }}-
28+
- name: Build dependencies
29+
run: |
30+
stack --no-terminal build --test --only-dependencies
31+
- name: Build
32+
run: |
33+
mkdir dist
34+
stack --no-terminal build --test --no-run-tests --copy-bins --local-bin-path dist
35+
- name: Test
36+
run: stack --no-terminal build --test
37+
- name: Zip
38+
run: |
39+
cd dist
40+
tar czvf vcr-proxy-linux.tar.gz vcr-proxy
41+
- name: Create Release
42+
id: create_release
43+
uses: actions/create-release@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
tag_name: ${{ github.ref }}
48+
release_name: Release ${{ github.ref }}
49+
draft: false
50+
prerelease: false
51+
- name: Upload Release Asset
52+
id: upload-release-asset
53+
uses: actions/upload-release-asset@v1
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
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
58+
asset_path: ./dist/vcr-proxy-linux.tar.gz
59+
asset_name: vcr-proxy-linux.tar.gz
60+
asset_content_type: application/x-tar

0 commit comments

Comments
 (0)