Skip to content

Commit 8170200

Browse files
authored
Create release.yml
try to updated the previous version of release.yml for Create release based on a tag workflow
1 parent c818d8c commit 8170200

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# github workflow to make a release
2+
name: Create release based on a tag
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger when a tag like v1.0.0 is pushed
7+
permissions:
8+
contents: write # Grants write permission to repository contents
9+
10+
jobs:
11+
release:
12+
name: Release pushed tag
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up Node ${{ matrix.node-version }}
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
cache: 'npm'
23+
- name: Install dependencies
24+
run: npm install
25+
- name: test
26+
run: npm run test
27+
- name: Build
28+
run: npm run build
29+
- name: Archive site content
30+
uses: thedoctor0/zip-release@master
31+
with:
32+
type: 'zip'
33+
directory: './dist'
34+
filename: xrpweb-v${{ github.run_number }}.zip
35+
- name: Create Release
36+
id: create_new_release
37+
uses: softprops/[email protected]
38+
with:
39+
tag_name: ${{ github.ref_name }}
40+
name: Release ${{ github.ref_name }}
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
- name: Upload Build artifacts
44+
uses: svenstaro/upload-release-action@v2
45+
with:
46+
repo_token: ${{ secrets.GITHUB_TOKEN }}
47+
file: xrpweb-v${{ github.run_number }}.zip
48+
asset_name: xrpweb
49+
tag: ${{ github.ref }}
50+
overwrite: true

0 commit comments

Comments
 (0)