Merge branch 'refactor' into fc-mem-patch #23
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: FC Versions | |
| on: | |
| push: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| id-token: write | |
| contents: write | |
| jobs: | |
| # Run parallel builds via reusable workflow | |
| build: | |
| uses: ./.github/workflows/build.yml | |
| publish: | |
| name: Collect and upload builds | |
| needs: build | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Download all build artifacts | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: builds | |
| pattern: firecracker-* | |
| merge-multiple: true | |
| - name: List downloaded builds | |
| run: find builds -type f | head -20 | |
| - name: Setup Service Account | |
| if: github.ref_name == 'main' | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| project_id: ${{ secrets.GCP_PROJECT_ID }} | |
| workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
| - name: Upload firecrackers to GCS | |
| if: github.ref_name == 'main' | |
| uses: "google-github-actions/upload-cloud-storage@v1" | |
| with: | |
| path: "./builds" | |
| destination: ${{ vars.GCP_BUCKET_NAME }}/firecrackers | |
| gzip: false | |
| parent: false | |
| - name: Create releases for each Firecracker version | |
| if: github.ref_name == 'main' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "[email protected]" | |
| for dir in ./builds/*/; do | |
| version_name=$(basename "$dir") | |
| binary_path="$dir/firecracker" | |
| echo "Processing $version_name..." | |
| # Check if tag already exists | |
| if git rev-parse "refs/tags/$version_name" >/dev/null 2>&1; then | |
| echo "Tag $version_name already exists, skipping..." | |
| continue | |
| fi | |
| # Check if release already exists | |
| if gh release view "$version_name" >/dev/null 2>&1; then | |
| echo "Release $version_name already exists, skipping..." | |
| continue | |
| fi | |
| echo "Creating tag and release for $version_name..." | |
| # Create and push tag | |
| git tag "$version_name" | |
| git push origin "$version_name" | |
| # Create release with the binary | |
| gh release create "$version_name" \ | |
| --title "Firecracker $version_name" \ | |
| --notes "Firecracker build: $version_name" \ | |
| "$binary_path#${version_name}" | |
| done |