Skip to content

Commit

Permalink
actions(release): build and finish from tran builder workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Feb 8, 2022
1 parent 90125bb commit 187a589
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Release

on:
push:
tags:
- '*'

env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GITHUB_ACTIONS_NAME: "github-actions[bot]"
GITHUB_ACTIONS_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"

permissions: write-all

jobs:
build_tran:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0

- name: Set up `Go`
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Set up `GoReleaser`
uses: goreleaser/goreleaser-action@v2
with:
install-only: true

- name: Set up `Tag`
id: ghtag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: Set up `Date`
run: go run ./scripts/date.go >> date.txt

- name: Build
run: BuildDate="$(cat date.txt)" goreleaser release --rm-dist --timeout 100m

- name: Setup `Node.js`
uses: actions/setup-node@v2.5.0
with:
node-version: 16

- name: Build `gh-tran`
env:
TAG: ${{ steps.ghtag.outputs.tag }}
run: |
DATE="$(cat date.txt)"
gh repo clone abdfnx/gh-tran
cd gh-tran
./release.sh $TAG $DATE
cd ../scripts/gh-tran
yarn && yarn start
- name: Commit files
env:
TAG: ${{ steps.ghtag.outputs.tag }}
run: |
cd ./scripts/gh-tran/tmp/gh-tran
git config --local user.email "${{ env.GITHUB_ACTIONS_EMAIL }}"
git config --local user.name "${{ env.GITHUB_ACTIONS_NAME }}"
git diff --cached
git add .
git commit -m "tran ${TAG}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
repository: "abdfnx/gh-tran"
github_token: ${{ secrets.ACCESS_TOKEN }}
directory: ./scripts/gh-tran/tmp/gh-tran

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_ID }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Build Tran Containers
run: |
make btc
make bftc

0 comments on commit 187a589

Please sign in to comment.