-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (97 loc) · 2.98 KB
/
release-tagged.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release Tagged
on:
push:
tags: ["v*"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Setup | Trunk
uses: jetli/[email protected]
with:
version: "latest"
- name: Build | Trunk
run: trunk build --release
- name: Post Setup | Upload dist
uses: actions/upload-artifact@v3
with:
path: ./dist/
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Download dist
uses: actions/download-artifact@v3
- name: Setup | Place dist
run: mv ./artifact/ ./dist/
- name: Release | Prepare artifacts
run: |
tar czvf dist.tar.gz dist
zip -9 -r dist.zip dist
- name: Release | Create checksums
run: |
openssl dgst -sha256 -r dist.tar.gz | awk '{print $1}' > dist.tar.gz.sha256
openssl dgst -sha256 -r dist.zip | awk '{print $1}' > dist.zip.sha256
# Upload to tag
- name: Release | Tagged
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
files: |
dist.tar.gz
dist.tar.gz.sha256
dist.zip
dist.zip.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Replace latest release
- name: Clean | Latest
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release | Latest
uses: softprops/action-gh-release@v1
with:
tag_name: "latest"
name: My Website
body: "The latest distributable compilation, usually denoted `public/` or `dist/`, of my website."
fail_on_unmatched_files: true
files: |
dist.tar.gz
dist.tar.gz.sha256
dist.zip
dist.zip.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
aws:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup | Download dist
uses: actions/download-artifact@v3
- name: Setup | Place dist
run: mv ./artifact/ ./dist/
- name: Configure | AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
role-duration-seconds: 1200
role-session-name: GitHubActions
- name: Deploy | S3
run: |
aws s3 sync ./dist/ s3://simbleau-website --delete