-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (72 loc) · 2.08 KB
/
development.yml
File metadata and controls
75 lines (72 loc) · 2.08 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
name: Beta Release
on:
schedule:
- cron: "0 12 */7 * *"
workflow_dispatch:
jobs:
json-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install jsonlint
run: npm install -g jsonlint
- name: Run JSON lint
run: |
#!/bin/bash
set -e
error_found=false
while IFS= read -r -d '' file
do
if ! jsonlint -q "$file"; then
echo "Error in file: $file"
jsonlint "$file"
error_found=true
fi
done < <(find . -name "*.json" -type f -print0)
if [ "$error_found" = true ] ; then
echo "JSON linting failed"
exit 1
fi
beta-release:
needs: json-lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create zip archive
run: |
zip -r repo.zip .
- name: Create tag
id: create_tag
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git tag -a beta-$(date +%Y%m%d%H%M%S) -m "Beta release"
git push origin beta-$(date +%Y%m%d%H%M%S)
echo "::set-output name=tag_name::beta-$(date +%Y%m%d%H%M%S)"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_tag.outputs.tag_name }}
release_name: Beta Release ${{ steps.create_tag.outputs.tag_name }}
body: |
This is a beta release of the ACRP.
draft: false
prerelease: true
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./repo.zip
asset_name: ACRP-preview.zip
asset_content_type: application/zip