ipfs release creation for testnet permissioned cycle 1 #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout github repo | |
uses: actions/checkout@v2 | |
- name: Fetch updated files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files_yaml: | | |
json: socializing-pool-merkle/** | |
id: changed_files | |
- name: Run step only if one file change in folder | |
if: steps.changed_files.outputs.json_all_changed_files_count != '1' | |
run: | | |
echo "ERROR: ${{ steps.changed_files.outputs.json_all_changed_files_count }} file/s changed in socializing-pool-merkle folder. Only one file change allowed." | |
echo "Files changed in socializing-pool-merkle folder: ${{ steps.changed_files.outputs.json_all_changed_files }}" | |
exit 1 | |
- name: Upload to IPFS | |
uses: aquiladev/[email protected] | |
id: ipfs_upload | |
with: | |
# Directory/File path to upload | |
path: ${{steps.changed_files.outputs.json_all_changed_files}} | |
# Type of target service to upload. Supported services [ipfs, pinata, infura, filebase] | |
service: infura # optional, default is ipfs | |
# [infura] Project ID. Required for infura service | |
infuraProjectId: ${{ secrets.INFURA_PROJECT_ID }} # optional | |
# [infura] Project Secret. Required for infura service | |
infuraProjectSecret: ${{ secrets.INFURA_PROJECT_SECRET }} # optional | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ steps.tag_version.outputs.new_tag }} | |
release_name: Release ${{ steps.tag_version.outputs.new_tag }} | |
body: | | |
file changed: [${{ steps.changed_files.outputs.json_all_changed_files }}](https://github.com/${{ github.repository }}/blob/${{ github.head_ref || github.ref_name }}/${{ steps.changed_files.outputs.json_all_changed_files }}) | |
ipfs hash: `${{steps.ipfs_upload.outputs.ipfs}}` | |
You can also access the Reward merkle trees from an IPFS gateway. | |
- https://ipfs.io/ipfs/${{steps.ipfs_upload.outputs.ipfs}} | |
- [ipfs://${{steps.ipfs_upload.outputs.ipfs}}](ipfs://${{steps.ipfs_upload.outputs.ipfs}}) | |
${{ steps.tag_version.outputs.changelog }} | |
draft: false | |
prerelease: false |