Skip to content

Commit 7358bd8

Browse files
committed
use github releases for downloads
1 parent 8c7829f commit 7358bd8

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/release.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy to Workers Prod
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@master
14+
15+
- name: Make temporary directory
16+
run: mkdir tmp
17+
18+
- name: Zip the SVGs
19+
run: cd docs && zip -q ../tmp/download.zip */u*.svg
20+
- run: unzip -l tmp/download.zip
21+
22+
- name: Tar and gzip the SVGs
23+
run: cd docs && tar -czf ../tmp/download.tar.gz */u*.svg
24+
- run: tar -tzf tmp/download.tar.gz
25+
26+
- run: echo "::set-env name=RELEASE_DATE::$(date -u +%Y-%m-%dT%H:%M:%SZ)"
27+
- run: echo "::set-env name=RELEASE_TAG::$(date -u +%Y%m%d-%H%M%S)"
28+
- run: echo "Release date is ${{ env.RELEASE_DATE }}"
29+
30+
- name: Create Release
31+
id: create_release
32+
uses: actions/create-release@v1
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
35+
with:
36+
tag_name: ${{ env.RELEASE_TAG }}
37+
release_name: Release ${{ env.RELEASE_DATE }}
38+
body: |
39+
Automatically created on LATER
40+
draft: false
41+
prerelease: false
42+
43+
- name: Upload .zip
44+
id: upload-zip
45+
uses: actions/upload-release-asset@v1.0.1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
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
50+
asset_path: ./tmp/download.zip
51+
asset_name: download.zip
52+
asset_content_type: application/zip
53+
54+
- name: Upload .tar.gz
55+
id: upload-tar-gz
56+
uses: actions/upload-release-asset@v1.0.1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
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
61+
asset_path: ./tmp/download.tar.gz
62+
asset_name: download.tar.gz
63+
asset_content_type: application/gzip

0 commit comments

Comments
 (0)