-
Notifications
You must be signed in to change notification settings - Fork 16
113 lines (97 loc) · 3.56 KB
/
Copy pathrelease.yml
File metadata and controls
113 lines (97 loc) · 3.56 KB
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
name: Tagged Build + Release
on:
# pull_request:
push:
tags:
- '*'
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true
env:
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
FVTT_PACKAGE_TOKEN: "${{ secrets.FVTT_PACKAGE_TOKEN }}"
S3_BUCKET: asacolips-artifacts
REF_TYPE: ${{ github.ref_type }}
REF: "${{ github.head_ref || github.ref_name}}"
jobs:
#####################################################################
### Build Job #######################################################
#####################################################################
build:
uses: ./.github/workflows/shared-build.yml
#####################################################################
### Deploy Job ######################################################
#####################################################################
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest
if: github.ref_type == 'tag' && github.repository_owner == 'asacolips-projects'
timeout-minutes: 60
steps:
- name: Retrieving git refs
uses: actions/checkout@v4.1.0
with:
fetch-depth: 50
lfs: false
- name: Download artifacts from previous step
uses: actions/download-artifact@v4.1.0
with:
name: build
- name: Get branch
run: echo "BRANCH=$(./.github/workflows/get-branch.sh)" >> $GITHUB_ENV
- name: S3 Upload
run: |
aws configure set region us-east-1
aws s3 cp ./pbta.zip s3://${S3_BUCKET}/pbta/${REF}/pbta.zip --acl="public-read"
aws s3 cp ./system.json s3://${S3_BUCKET}/pbta/${REF}/system.json --acl="public-read"
aws s3 cp ./system.json s3://${S3_BUCKET}/pbta/${BRANCH}/system.json --acl="public-read"
- name: Verify release notes exist
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "release-notes/${{ env.REF }}.md"
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
if: steps.check_files.outputs.files_exists == 'true'
with:
bodyFile: release-notes/${{ env.REF }}.md
draft: false
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }} # Provided by actions.
#####################################################################
### FVTT Package Manager Release Job ################################
#####################################################################
fvtt_release:
name: FVTT Package Release
needs: deploy
runs-on: ubuntu-latest
container:
image: node:20
if: github.ref_type == 'tag' && github.repository_owner == 'asacolips-projects' && contains(github.ref_name, 'beta') == false && contains(github.ref_name, 'alpha') == false
timeout-minutes: 60
steps:
- name: Retrieving git refs
uses: actions/checkout@v4.1.0
with:
fetch-depth: 50
lfs: false
- name: Download artifacts from previous step
uses: actions/download-artifact@v4.1.0
with:
name: build
- name: Retrieving cache
uses: actions/cache@v4
with:
path: node_modules/
key: node-${{ hashFiles('package-lock.json') }}
restore-keys: node-
- name: Install NPM dependencies
run: npm install
- name: Create FVTT Release
id: create_fvtt_release
run: node ./.github/workflows/foundry-package-release.mjs --fvtt_token=${FVTT_PACKAGE_TOKEN}