This repository has been archived by the owner on Jul 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
64 lines (64 loc) · 2.09 KB
/
main.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
name: Create Release Archive
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Get tag
id: tagName
uses: dawidd6/action-get-tag@v1
- name: Patch files
uses: onlyutkarsh/patch-files-action@v1.0.2
env:
author: ^ and stick#0520
with:
files: |
module.json
patch-syntax: |
= /version => "${{ steps.tagName.outputs.tag }}"
= /author => "${{ env.author }}"
= /download => "https://github.com/espositos/fvtt-tokenactionhud/releases/download/${{ steps.tagName.outputs.tag }}/release_${{ steps.tagName.outputs.tag }}.zip"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tagName.outputs.tag }}
release_name: Release_${{ steps.tagName.outputs.tag }}
draft: false
prerelease: false
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
filename: 'release_${{ steps.tagName.outputs.tag }}.zip'
exclusions: '*.git* *.md .editorconfig foundry.js'
- name: Upload Release Asset
id: 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: ./release_${{ steps.tagName.outputs.tag }}.zip
asset_name: release_${{ steps.tagName.outputs.tag }}.zip
asset_content_type: application/zip
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add module.json
git commit -m "Update module.json"
- name: Push changes to master
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master