mirror of
https://github.com/lindbergh-loader/lindbergh-loader.git
synced 2026-10-13 17:48:27 +03:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f90591690 | ||
|
|
a3d476c584 | ||
|
|
6d799d7524 | ||
|
|
73d0c9fb57 |
+18
-14
@@ -12,58 +12,62 @@ permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-and-release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Checkout the repository
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Set up Docker Buildx
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
# Build the Docker image
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build --target lindbergh-build -t lindbergh-loader .
|
||||
|
||||
# Extract build artifacts
|
||||
- name: Extract build artifacts
|
||||
run: |
|
||||
docker create --name lindbergh-builder lindbergh-loader
|
||||
docker cp lindbergh-builder:/output ./build
|
||||
docker rm lindbergh-builder
|
||||
|
||||
# Compress the build directory
|
||||
- name: Compress build directory
|
||||
run: tar -czvf build.tar.gz -C ./build .
|
||||
|
||||
# Archive the build directory as an artifact for debugging
|
||||
- name: Archive build directory
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-output
|
||||
path: ./build
|
||||
|
||||
release:
|
||||
if: github.event_name == 'push'
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-output
|
||||
path: ./build
|
||||
|
||||
# Create a GitHub release and capture the upload URL (only on push events)
|
||||
- name: Create Release
|
||||
if: github.event_name == 'push'
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: v${{ github.run_number }}
|
||||
release_name: "Lindbergh Loader v${{ github.run_number }}"
|
||||
release_name: "Build v${{ github.run_number }}"
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
# Upload the compressed build artifact to the release (only on push events)
|
||||
- name: Upload Release Asset
|
||||
if: github.event_name == 'push'
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./build
|
||||
asset_path: ./build.tar.gz
|
||||
asset_name: build.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
|
||||
Reference in New Issue
Block a user