Skip to content

New version release

New version release #2

name: New version release
description: Bump version, push to IPFS, and create GitHub Release
on:
workflow_dispatch:
inputs:
release-type:
description: "Type of version bump"
required: true
default: patch
type: choice
options:
- major
- minor
- patch
jobs:
bump-version:
runs-on: ubuntu-latest
environment: production
outputs:
new_tag: ${{ steps.bump_version.outputs.new_tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Bump version
id: bump_version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
NEW_TAG=$(npm version ${{ inputs.release-type }})
echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT
- name: Push version commit and tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git push origin HEAD:main
git push origin --tags
push-to-ipfs:
needs: bump-version
runs-on: ubuntu-22.04
outputs:
cid: ${{ steps.push_to_ipfs.outputs.cid }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build and Export
uses: aleph-im/aleph-github-actions/build-nextjs-app@v1
with:
fa-token: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
env:
NEXT_PUBLIC_BUILDER_API_KEY: ${{ secrets.BUILDER_API_KEY }}
NEXT_PUBLIC_THEME: "twentysix"
NEXT_PUBLIC_SITE_HOME_URL: "https://aleph.cloud/"
- name: Push to IPFS
id: push_to_ipfs
uses: aleph-im/aleph-github-actions/push-to-ipfs@v1.1.1
with:
upload-dir: out
create-release:
needs: [bump-version, push-to-ipfs]
runs-on: ubuntu-latest
steps:
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.bump-version.outputs.new_tag }}
release_name: Release ${{ needs.bump-version.outputs.new_tag }}
body: |
**IPFS CID:** `${{ needs.push-to-ipfs.outputs.cid }}`
draft: false
prerelease: false