Commit 2b75adda authored by Annie Ke's avatar Annie Ke Committed by GitHub

[Feat] Autopublish with new version (#261)

* [Feat] Autopublish with new version

* rebase and incorporate state dump

* Update .github/workflows/tag-release.yml
Co-authored-by: default avatarLiam Horne <liam@lihorne.com>
Co-authored-by: default avatarLiam Horne <liam@lihorne.com>
Co-authored-by: default avatarMark Tyneway <mark.tyneway@gmail.com>
parent 9d25e0a5
name: Create Releases on Tags name: Auto tag-release-publish
on: on:
push: push:
tags: branches:
- 'v*' - master
jobs: jobs:
release: tag:
name: Create tag for new version
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.create_new_tag.outputs.tag }}
steps: steps:
- name: Create GitHub release - uses: actions/checkout@v2
uses: Roang-zero1/github-create-release-action@master
with: with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ fetch-depth: 2
changelog_file: CHANGELOG.md - uses: salsify/action-detect-and-tag-new-version@v2
id: create_new_tag
release:
name: Create release
runs-on: ubuntu-latest
needs: tag
if: needs.tag.outputs.tag_name
steps:
- uses: actions/checkout@v2
- uses: actions/create-release@v1
id: create_release
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.tag.outputs.tag_name }}
release_name: ${{ needs.tag.outputs.tag_name }}
draft: false
prerelease: false
npm-publish:
name: Build and publish
runs-on: ubuntu-latest
needs: tag
if: needs.tag.outputs.tag_name
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
docker: docker:
name: Build & Push to DockerHub name: Build & Push to DockerHub
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: tag
if: needs.tag.outputs.tag_name
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Login to DockerHub Registry - name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} | docker login -u ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME}} --password-stdin run: echo ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} | docker login -u ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME}} --password-stdin
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Clone the docker repo - name: Clone the docker repo
run: | run: |
git clone https://github.com/ethereum-optimism/docker.git \ git clone https://github.com/ethereum-optimism/docker.git \
...@@ -39,8 +71,8 @@ jobs: ...@@ -39,8 +71,8 @@ jobs:
- name: Build and push Deployer image to DockerHub - name: Build and push Deployer image to DockerHub
run: | run: |
cd $HOME/docker cd $HOME/docker
./build.sh -s deployer -b ${{ steps.get_version.outputs.VERSION }} ./build.sh -s deployer -b ${{ needs.tag.outputs.tag_name }}
docker push ethereumoptimism/deployer:${{ steps.get_version.outputs.VERSION }} docker push ethereumoptimism/deployer:${{ needs.tag.outputs.tag_name }}
- name: Extract State Dump from Deployer Image - name: Extract State Dump from Deployer Image
run: docker run --rm --entrypoint cat ethereumoptimism/deployer:${{ steps.get_version.outputs.VERSION }} /opt/contracts/build/dumps/state-dump.latest.json > ${{ steps.get_version.outputs.VERSION }}.json run: docker run --rm --entrypoint cat ethereumoptimism/deployer:${{ steps.get_version.outputs.VERSION }} /opt/contracts/build/dumps/state-dump.latest.json > ${{ steps.get_version.outputs.VERSION }}.json
...@@ -58,6 +90,8 @@ jobs: ...@@ -58,6 +90,8 @@ jobs:
name: Commit State Dump name: Commit State Dump
needs: docker needs: docker
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: tag
if: needs.tag.outputs.tag_name
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment