Skip to content

chore: Update dependencies and workflows #36

chore: Update dependencies and workflows

chore: Update dependencies and workflows #36

Workflow file for this run

name: Continuous Integration
on:
push:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build and release from'
required: false
default: 'main'
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-release:
# Unless the branch is specified, only run on the default branch
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/${{ github.event.inputs.branch || github.ref }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# - id: commit
# uses: pr-mpt/actions-commit-hash@v1
# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version: 1.18
- name: Cross compile
uses: crazy-max/ghaction-xgo@v3
with:
xgo_version: latest
go_version: 1.22
dest: /home/runner/work/cross-blogger/builds
prefix: cross-blogger
# targets: windows/amd64,linux/amd64,linux/arm64,darwin/arm64,windows/arm,windows/arm64,linux/arm,darwin/amd64
- name: Compress releases
run: zip -r /home/runner/work/cross-blogger/binaries.zip /home/runner/work/cross-blogger/builds/*
# - name: Delete old release
# with:
# tag_name: rolling
- name: Update tag
uses: EndBug/latest-tag@latest
with:
ref: rolling
- name: Release
uses: softprops/action-gh-release@v2
with:
name: Rolling release
prerelease: true
# tag_name: ${{ steps.commit.outputs.short }}
tag_name: rolling
# generate_release_notes: true
body: "Latest commit: ${{ github.event.head_commit.message }}"
files: |
/home/runner/work/cross-blogger/binaries.zip
/home/runner/work/cross-blogger/builds/*
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: binaries
path: /home/runner/work/cross-blogger/builds/*
# - name: Rolling Publish
# uses: WebFreak001/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically provided by github actions
# with:
# upload_url: https://uploads.github.com/repos/slashtechno/cross-blogger/releases/74787789/assets{?name,label} # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
# release_id: 74787789 # same as above (id can just be taken out the upload_url, it's used to find old releases)
# asset_path: /home/runner/work/cross-blogger/binaries.zip # path to archive to upload
# asset_name: cross-blogger-binaries-rolling-$$.zip # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash
# asset_content_type: application/zip # required by GitHub API
# max_releases: 2 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
# - name: Build
# run: go build -v ./main.go