-
Notifications
You must be signed in to change notification settings - Fork 87
50 lines (42 loc) · 1.27 KB
/
release.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
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
name: "Release"
runs-on: "ubuntu-latest"
steps:
- name: "Import workspace"
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: "Set env"
run: 'echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV'
- name: Git setup
run: |
git fetch
git checkout main
git config --global user.name "FelixSelter"
git config --global user.email "felixselterdeveloping@gmail.com"
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v2
with:
include: "src/jenv.ps1"
find: 'JENV_VERSION = "(.+?)"'
replace: 'JENV_VERSION = "${{ env.RELEASE_VERSION }}"'
regex: true
- name: Commit and push changes
run: |
git add src/jenv.ps1
git commit -m "Inserted version into source file"
git push
- name: "Zip files"
run: "zip -r JEnv.zip src/ jenv.bat java.bat"
- name: "Create Release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: JEnv.zip