Skip to content

Commit eb2794a

Browse files
authored
Merge pull request #119 from nspcc-dev/build-deploy-workflow
2 parents 5ab1c38 + 1c8ac84 commit eb2794a

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types: [opened, synchronize]
8+
paths-ignore:
9+
- '**/*.md'
10+
push:
11+
# Build for the master branch.
12+
branches:
13+
- master
14+
release:
15+
types:
16+
- published
17+
workflow_dispatch:
18+
inputs:
19+
ref:
20+
description: 'Ref to build [default: latest master; examples: v0.4.0, 9595da7d83efc330ca0bc94bef482e4edfbcf8fd]'
21+
required: false
22+
default: ''
23+
deploy:
24+
description: 'Deploy to production [default: false; examples: true, false]'
25+
required: false
26+
default: 'false'
27+
28+
jobs:
29+
build_release:
30+
name: Build and deploy
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
ref: ${{ github.event.inputs.ref }}
37+
# Allows to fetch all history for all branches and tags. Need this for proper versioning.
38+
fetch-depth: 0
39+
40+
- name: Build
41+
run: make release
42+
43+
- name: Upload artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: release
47+
path: ./send.fs.neo.org-*.tar.gz
48+
if-no-files-found: error
49+
50+
- name: Attach binary to the release as an asset
51+
if: ${{ github.event_name == 'release' }}
52+
run: gh release upload ${{ github.event.release.tag_name }} ./send.fs.neo.org-*.tar.gz
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Publish to NeoFS
57+
if: ${{ github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true') }}
58+
uses: nspcc-dev/gh-push-to-neofs@master
59+
with:
60+
NEOFS_WALLET: ${{ secrets.NEOFS_WALLET }}
61+
NEOFS_WALLET_PASSWORD: ${{ secrets.NEOFS_WALLET_PASSWORD }}
62+
NEOFS_NETWORK_DOMAIN: ${{ vars.NEOFS_NETWORK_DOMAIN }}
63+
NEOFS_HTTP_GATE: ${{ vars.NEOFS_HTTP_GATE }}
64+
STORE_OBJECTS_CID: ${{ vars.STORE_OBJECTS_CID }}
65+
PATH_TO_FILES_DIR: send.fs.neo.org
66+
STRIP_PREFIX: true
67+
REPLACE_CONTAINER_CONTENTS: true

0 commit comments

Comments
 (0)