Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
ci: add separate release and push update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitamet committed Jul 30, 2023
1 parent 0648a17 commit 323ba18
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/push-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Push Update

on:
release:
types: [published]

jobs:
push-update-windows:
name: Push Update
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags

- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"

- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: release-app.yaml
workflow_conclusion: success
branch: master
event: push
path: ./binaries
if_no_artifact_found: fail

- name: Install go-selfupdate
run: go install github.com/sanbornm/go-selfupdate/cmd/go-selfupdate@latest

- name: Create update manifest and archive
id: create_manifest_and_archive
shell: bash
run: |
go-selfupdate -o update ./binaries ${{ steps.previoustag.outputs.tag }}
- name: Upload update manifest and archive to S3
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ secrets.AWS_BUCKET }}
endpoint: ${{ secrets.AWS_ENDPOINT }}
source_dir: 'update'
destination_dir: 'update'
48 changes: 48 additions & 0 deletions .github/workflows/release-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
branches: [main]
tags:
- "v*.*.*"

jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"

- uses: dAppServer/wails-build-action@v2.2
with:
build-name: geemo.exe
build-platform: windows/amd64
package: false
nsis: false

- name: Upload Artifact in GOOS-GOARCH format
uses: actions/upload-artifact@v3
with:
name: windows-amd64
path: ./build/bin/geemo.exe

release:
name: Release
needs: build
runs-on: ubuntu-20.04
steps:
- name: Zip
run: |
cd ./build/bin
zip -r geemo-${{github.ref_name}}.zip geemo.exe
mv geemo-${{github.ref_name}}.zip ../../
- name: Release
uses: softprops/action-gh-release@v1
with:
files: geemo-${{github.ref_name}}.zip
draft: true

0 comments on commit 323ba18

Please sign in to comment.