-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
42 lines (42 loc) · 1.38 KB
/
action.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
name: 'Create contracts release file'
description: 'Generates release.txt from a given repo with all the smart contract artifacts.'
inputs:
target-path:
description: 'Path to search for the artifacts list.'
required: true
default: 'contracts/target/release'
runs:
using: "composite"
steps:
- name: Get Version Tag
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Test
shell: bash
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Check TARGET_DIRECTORY
shell: bash
run: |
if [ -z "${{ inputs.target-path }}" ]
then
echo "TARGET_DIRECTORY=contracts/target/release" >> $GITHUB_ENV
else
echo "TARGET_DIRECTORY=${{ inputs.target-path }}" >> $GITHUB_ENV
fi
- name: Generate and push release artifacts
shell: bash
run: |
git config user.name github-actions
git config user.email [email protected]
date > release.txt
find ${{ inputs.target-path }} -print >> sclib-release.txt
git add sclib-release.txt
git commit -m "Generate SC lib release file"
git tag ${{ env.RELEASE_VERSION }}+scdist
git push origin ${{ env.RELEASE_VERSION }}+scdist