-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actions(release): build and finish from tran builder workflow
- Loading branch information
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
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
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 |