factorio-server-manager/.github/workflows/create-release-workflow.yml

69 lines
2.4 KiB
YAML

on:
release:
types: [published]
jobs:
add-assets-to-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/setup-go@v2
- name: Install mingw-w64
run: sudo apt-get update && sudo apt-get install gcc-multilib g++-multilib gcc-mingw-w64 g++-mingw-w64
- name: Get git tag
id: tag_name
uses: little-core-labs/get-git-tag@v3.0.2
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create release bundles
run: make gen_release
- name: Upload release (windows)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./build/factorio-server-manager-windows.zip
asset_name: factorio-server-manager-windows-${{ steps.tag_name.outputs.tag }}.zip
asset_content_type: application/octet-stream
- name: Upload release (linux)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./build/factorio-server-manager-linux.zip
asset_name: factorio-server-manager-linux-${{ steps.tag_name.outputs.tag }}.zip
asset_content_type: application/octet-stream
docker-push:
needs: ['add-assets-to-release']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/setup-go@v2
- uses: docker/setup-buildx-action@v1
- name: Get git tag
id: tag_name
uses: little-core-labs/get-git-tag@v3.0.2
- name: Login to dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: make build; cp build/factorio-server-manager-linux.zip docker/factorio-server-manager-linux.zip
- uses: docker/build-push-action@v2
with:
context: ./docker/
file: ./docker/Dockerfile-local
push: true
tags: ofsm/ofsm:latest,ofsm/ofsm:${{ steps.tag_name.outputs.tag }}