Skip to content

release

release #16

Workflow file for this run

name: release
permissions:
contents: write
on:
push:
tags:
- "v*"
schedule:
- cron: "30 0 * * 1" # At 00:30 on Monday.
workflow_dispatch:
jobs:
prepare:
name: prepare
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.release_info.outputs.tag_name }}
steps:
- id: release_info
run: |
echo "tag_name=$(date +"%Y-%m-%d-%H-%M")" >> $GITHUB_OUTPUT
build:
needs: [prepare]
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Checkout
uses: actions/checkout@v4
with:
repository: "Conflux-Chain/sirius"
path: sirius
ref: dev
- name: Checkout
uses: actions/checkout@v4
with:
repository: "Conflux-Chain/sirius-eth"
path: sirius-eth
ref: dev
- name: Install dependencies
run: |
cd sirius
yarn
cd ..
cd sirius-eth
yarn
cd ..
- name: Build
run: |
cd sirius
yarn build:static
cd ..
cd sirius-eth
yarn build:static
cd ..
- name: Copy config
run: |
cd sirius
cp ./config.example ./build/config.json
cd ..
cd sirius-eth
cp ./config.example ./build/config.json
cd ..
- name: Create build tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ needs.prepare.outputs.tag_name }}",
sha: context.sha
})
- name: Zip artifacts
run: |
mv ./sirius/build ./build && zip -r scan.zip ./build && rm -rf ./build
mv ./sirius-eth/build ./build && zip -r scan-eth.zip ./build && rm -rf ./build
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: ${{ needs.prepare.outputs.tag_name }}
tag_name: ${{ needs.prepare.outputs.tag_name }}
files: |
scan.zip
scan-eth.zip