diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml new file mode 100644 index 0000000..da2ce71 --- /dev/null +++ b/.forgejo/workflows/release.yaml @@ -0,0 +1,53 @@ +name: Build and Release + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y chafa libglib2.0-dev + + - name: Build binary + run: make build + + - name: Test binary + run: ./gogofetch --version + + - name: Package release artifact + run: | + tar -czvf gogofetch-${{ github.ref_name }}-linux-amd64.tar.gz gogofetch Makefile logos/ + + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref_name }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./gogofetch-${{ github.ref_name }}-linux-amd64.tar.gz + asset_name: gogofetch-${{ github.ref_name }}-linux-amd64.tar.gz + asset_content_type: application/gzip \ No newline at end of file