Skip to content

Commit 4ee1395

Browse files
committed
ci: switch to reusable workflows
1 parent 65c9ca1 commit 4ee1395

File tree

3 files changed

+6
-151
lines changed

3 files changed

+6
-151
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -16,96 +16,4 @@ env:
1616

1717
jobs:
1818
build:
19-
runs-on: windows-latest
20-
steps:
21-
-
22-
name: Checkout
23-
uses: actions/checkout@v3
24-
-
25-
name: Set up Go
26-
uses: actions/setup-go@v3
27-
with:
28-
go-version: ${{ env.GO_VERSION }}
29-
-
30-
name: Set up Node
31-
uses: actions/setup-node@v3
32-
with:
33-
node-version: ${{ env.NODE_VERSION }}
34-
-
35-
name: Set up Java
36-
uses: actions/setup-java@v3
37-
with:
38-
distribution: adopt
39-
java-version: ${{ env.JAVA_VERSION }}
40-
-
41-
name: Set up ANT
42-
run: |
43-
choco install ant --no-progress --force -y --version $Env:ANT_VERSION
44-
$Env:PATH = "C:\ProgramData\chocolatey\lib\ant\tools\apache-ant-$Env:ANT_VERSION\bin;$Env:PATH"
45-
echo "ANT_HOME=C:\ProgramData\chocolatey\lib\ant\tools\apache-ant-$Env:ANT_VERSION" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
46-
-
47-
name: Java version
48-
run: |
49-
java -XshowSettings:properties -version
50-
-
51-
name: ANT version
52-
run: |
53-
ant -version
54-
-
55-
name: Node version
56-
run: |
57-
node --version
58-
-
59-
name: Config
60-
run: |
61-
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
62-
echo "$(go env GOPATH)/bin/windows_386" >> $GITHUB_PATH
63-
64-
echo "PORTAPPS_VERSION=$(cat go.mod | grep github.com/portapps/portapps | awk '{print $NF}')" >> $GITHUB_ENV
65-
echo "PORTAPPS_DIR=./.portapps" >> $GITHUB_ENV
66-
67-
if [[ $GITHUB_REF == refs/tags/* ]]; then
68-
echo "GIT_TAGNAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
69-
fi
70-
shell: bash
71-
-
72-
name: Checkout core
73-
uses: actions/checkout@v3
74-
with:
75-
repository: portapps/portapps
76-
ref: ${{ env.PORTAPPS_VERSION }}
77-
path: ${{ env.PORTAPPS_DIR }}
78-
-
79-
name: Cache Go modules
80-
uses: actions/cache@v3
81-
with:
82-
path: ~/go/pkg/mod
83-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
84-
restore-keys: |
85-
${{ runner.os }}-go-
86-
-
87-
name: Build
88-
run: |
89-
ant release -Dcore.dir=${{ env.PORTAPPS_DIR }}
90-
shell: bash
91-
-
92-
name: Upload assets
93-
uses: actions/upload-artifact@v3
94-
with:
95-
name: ${{ github.event.repository.name }}
96-
path: bin/release/*
97-
-
98-
name: GitHub Release
99-
uses: softprops/action-gh-release@v1
100-
if: startsWith(github.ref, 'refs/tags/')
101-
with:
102-
draft: true
103-
files: |
104-
bin/release/*
105-
name: ${{ env.GIT_TAGNAME }}
106-
env:
107-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108-
-
109-
name: Dump context
110-
if: always()
111-
uses: crazy-max/ghaction-dump-context@v1
19+
uses: portapps/.github/.github/workflows/app-build.yml@master

.github/workflows/gosum.yml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,4 @@ on:
1111

1212
jobs:
1313
fix:
14-
runs-on: ubuntu-latest
15-
steps:
16-
-
17-
name: Checkout
18-
uses: actions/checkout@v3
19-
-
20-
name: Set up Go
21-
uses: actions/setup-go@v2
22-
with:
23-
go-version: 1.18
24-
-
25-
name: Tidy
26-
run: |
27-
rm -f go.sum
28-
go mod tidy
29-
-
30-
name: Set up Git
31-
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
run: |
34-
git config user.name GitHub
35-
git config user.email [email protected]
36-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
37-
-
38-
name: Commit and push changes
39-
run: |
40-
git add .
41-
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
42-
git commit --author "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" --message "Fix go modules"
43-
git push
44-
fi
14+
uses: portapps/.github/.github/workflows/app-gosum.yml@master

.github/workflows/released.yml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,7 @@ on:
66

77
jobs:
88
virustotal:
9-
runs-on: ubuntu-latest
10-
steps:
11-
-
12-
name: Prepare
13-
id: prepare
14-
run: |
15-
echo ::set-output name=date::$(date -u +'%Y%m%d')
16-
-
17-
name: VirusTotal Monitor Scan
18-
uses: crazy-max/ghaction-virustotal@v3
19-
with:
20-
vt_api_key: ${{ secrets.VT_MONITOR_API_KEY }}
21-
vt_monitor: true
22-
monitor_path: /portapps/${{ steps.prepare.outputs.date }}/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
23-
update_release_body: false
24-
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
files: |
26-
${{ github.event.repository.name }}-(win32|win64).exe
27-
-
28-
name: VirusTotal Scan
29-
uses: crazy-max/ghaction-virustotal@v3
30-
with:
31-
vt_api_key: ${{ secrets.VT_API_KEY }}
32-
update_release_body: true
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
files: |
35-
${{ github.event.repository.name }}-(win32|win64).exe
9+
uses: portapps/.github/.github/workflows/app-virustotal.yml@master
10+
secrets:
11+
vt_api_key: ${{ secrets.VT_API_KEY }}
12+
vt_monitor_api_key: ${{ secrets.VT_MONITOR_API_KEY }}

0 commit comments

Comments
 (0)