Fix folder #2
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: | |
| permissions: | |
| id-token: write | |
| contents: write | |
| jobs: | |
| publish: | |
| name: Build Firecracker and upload | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.VERSION_BUMPER_APPID }} | |
| private-key: ${{ secrets.VERSION_BUMPER_SECRET }} | |
| - name: Get the last release | |
| id: last_release | |
| continue-on-error: true | |
| uses: cardinalby/git-get-release-action@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| latest: true | |
| prerelease: false | |
| draft: false | |
| - name: Get next version | |
| id: get-version | |
| run: | | |
| if [ "${{ steps.last_release.outputs.tag_name }}" == "" ]; then | |
| echo "No previous release found, starting with v0.0.1" | |
| echo "version=v0.0.1" >> $GITHUB_OUTPUT | |
| else | |
| version=${{ steps.last_release.outputs.tag_name }} | |
| result=$(echo ${version} | awk -F. -v OFS=. '{$NF += 1 ; print}') | |
| echo "version=$result" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Test next version | |
| run: echo "Next version is ${{ steps.get-version.outputs.version }}" | |
| - name: Setup Service Account | |
| uses: google-github-actions/auth@v1 | |
| with: | |
| workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
| service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} | |
| - name: Build kernels | |
| run: sudo make build | |
| - name: Upload kernels as artifact | |
| if: github.ref_name != 'main' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: firecracker-${{ github.run_id }} | |
| path: ./builds | |
| retention-days: 7 | |
| - name: Upload kernels | |
| 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 Git tag | |
| if: github.ref_name == 'main' | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git tag ${{ steps.get-version.outputs.version }} | |
| git push origin ${{ steps.get-version.outputs.version }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare release assets | |
| if: github.ref_name == 'main' | |
| run: | | |
| mkdir -p release-assets | |
| for dir in ./builds/*/; do | |
| name=$(basename "$dir") | |
| cp "$dir/vmlinux.bin" "release-assets/${name}.bin" | |
| done | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Release Asset | |
| if: github.ref_name == 'main' | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| name: Kernels ${{ steps.get-version.outputs.version }} | |
| tag_name: ${{ steps.get-version.outputs.version }} | |
| files: "./release-assets/*" |