-
Notifications
You must be signed in to change notification settings - Fork 219
114 lines (98 loc) · 2.89 KB
/
build_release.yaml
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
113
114
name: Docker Build Master
on:
push:
tags:
- 'v*.*.*'
jobs:
prepare_release:
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
prerelease: true
build_deploy:
name: Build and publish app
needs: [ prepare_release ]
runs-on: ubuntu-latest
steps:
- name: Install Node.js and NPM
uses: actions/setup-node@v2
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Check out Git repository
uses: actions/checkout@v2
- name: Update version in package.json
run: |
npm version ${GITHUB_REF_NAME:1} --allow-same-version --git-tag-version=false
- name: Create bundle
run: scripts/create-bundle.sh
- name: NPM deploy
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_TOKEN }}
run: |
cd _releases
mkdir _pkg
cd _pkg
tar xzf ../psitransfer-$GITHUB_REF_NAME.tar.gz --strip 1
npm publish
cd ../..
- name: Add Release artifact
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
fail_on_unmatched_files: false
files: |
_releases/psitransfer-*.tar.gz
publish_release:
name: Publish Release
runs-on: ubuntu-latest
needs: [ build_deploy ]
steps:
- name: Create Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitMode: true
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: false
body: ${{steps.build_changelog.outputs.changelog}}
build_docker:
name: Docker build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: psitrax
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v2
env:
DOCKER_TAG: latest
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
psitrax/psitransfer:${{ github.ref_name }}
ghcr.io/psi-4ward/psitransfer:${{ github.ref_name }}