Skip to content

Commit

Permalink
github actions: Create install bundle workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andsens committed May 13, 2024
1 parent 0e9269f commit 291e5e8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bundle.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bundle
name: Bundle as μpkg package

on:
push:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/install-bundle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Bundle as install package

on:
push:
branches: ['*']
tags: ['!v*']
workflow_call: {}

jobs:
install-bundle:
name: Create upkg-install.tar.gz
runs-on: ubuntu-latest
steps:
- name: Download μpkg bundle
uses: actions/download-artifact@v4
with:
name: upkg.tar.gz
- name: Create install package
run: |
checksum=$(shasum -a 256 upkg.tar.gz | cut -d ' ' -f1)
mkdir -p install/bin install/lib/upkg/.upkg/.packages install/lib/upkg/.upkg/.bin
tar -xzC install/lib/upkg/upkg.tar@$checksum -f upkg.tar.gz
ln -sT install/lib/upkg/.upkg/.packages/upkg.tar@$checksum install/lib/upkg/.upkg/upkg
ln -sT install/bin/upkg install/lib/upkg/.upkg/.bin/upkg
- name: Create upkg-install.tar.gz
run: tar -czC install -f upkg-install.tar.gz bin lib
- name: Upload upkg-install.tar.gz
uses: actions/upload-artifact@v4
with:
name: upkg-install.tar.gz
path: upkg-install.tar.gz
retention-days: 1
10 changes: 7 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
create-release:
needs: [test, bundle]
needs: [test, install-bundle]
runs-on: ubuntu-latest
name: Create μpkg GitHub release
environment: release
Expand All @@ -25,17 +25,21 @@ jobs:
printf "message<<%s\n%s\n%s\n" "$eof" "$msg" "$eof" >> $GITHUB_OUTPUT
env:
REF: ${{ github.ref }}
- name: Download μpkg bundle
- name: Download μpkg package
uses: actions/download-artifact@v4
with:
name: upkg.tar.gz
- name: Download μpkg install package
uses: actions/download-artifact@v4
with:
name: upkg-install.tar.gz
- name: Create Release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.program_version.outputs.version }}
body: ${{ steps.tag-message.outputs.message }}
draft: false
prerelease: false
artifacts: upkg.tar.gz
artifacts: upkg.tar.gz,upkg-install.tar.gz
artifactErrorsFailBuild: true
artifactContentType: application/gzip

0 comments on commit 291e5e8

Please sign in to comment.