mirror of
https://github.com/samuelncui/yatm.git
synced 2026-01-08 22:23:16 +00:00
57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
# This workflow will build this project
|
|
|
|
name: Build
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Set env
|
|
run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
|
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: "${{ env.RELEASE_VERSION }}"
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.20'
|
|
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v3.8.1
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Build
|
|
run: ./build.sh
|
|
|
|
- name: Upload Release Asset
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: ./yatm-linux-amd64-${{ env.RELEASE_VERSION }}.tar.gz
|
|
asset_name: yatm-linux-amd64-${{ env.RELEASE_VERSION }}.tar.gz
|
|
asset_content_type: application/x-tgz
|
|
|
|
# - uses: "marvinpinto/action-automatic-releases@latest"
|
|
# with:
|
|
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
# automatic_release_tag: "${{ env.RELEASE_VERSION }}"
|
|
# prerelease: false
|
|
# title: "Automatic Build"
|
|
# files: |
|
|
# LICENSE
|
|
# README.md
|
|
# yatm-linux-amd64-${{ env.RELEASE_VERSION }}.tar.gz
|