Skip to content

Commit

Permalink
Add GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
smallmodel committed Oct 17, 2024
1 parent 60062e2 commit 7398a45
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build branch

on:
push:
branches:
- '**'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-all:
uses: ./.github/workflows/shared-build.yml
21 changes: 21 additions & 0 deletions .github/workflows/shared-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Shared build workflow

on:
workflow_call:

jobs:
create-archive:
name: "Creating archive"
runs-on: "ubuntu-24.04"

steps:
- uses: actions/checkout@v4
with:
path: 'source'

- uses: actions/upload-artifact@v4
with:
name: out-linux-${{matrix.architecture.name}}
if-no-files-found: error
path:
${{github.workspace}}/install
37 changes: 37 additions & 0 deletions .github/workflows/tags-publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish artifacts

on:
push:
tags:
- "v*.*.*"

permissions:
contents: write

jobs:
build-file:
uses: ./.github/workflows/shared-build.yml

publish-release:
runs-on: "ubuntu-24.04"
environment: "release"
needs: [build-file]

env:
RELEASE_NAME: ${{ github.event.repository.name }}-${{github.ref_name}}

steps:
- uses: actions/download-artifact@v4
with:
name: 'out-archive'
path: ${{github.workspace}}/archive

- name: Zip
working-directory: ${{github.workspace}}/archive
run: zip -r ../${{ env.RELEASE_NAME }}.zip ./

- name: Release
uses: softprops/action-gh-release@v2
with:
name: '${{github.ref_name}}'
files: ${{github.workspace}}/${{ env.RELEASE_NAME }}.zip

0 comments on commit 7398a45

Please sign in to comment.