Fix #15
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 Kernels | |
on: | |
push: | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
publish: | |
name: Upload kernels | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get the last release | |
id: last_release | |
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: | | |
version=v0.0.0 | |
result=$(echo ${version} | awk -F. -v OFS=. '{$NF += 1 ; print}') | |
echo "{version}={$result}" >> $GITHUB_OUTPUT | |
- 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: kernels-${{ 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 }}/kernels | |
gzip: false | |
parent: false | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: Kernels ${{ steps.get-version.outputs.version }} | |
commit: ${{ github.sha }} | |
tag: ${{ steps.get-version.outputs.get-version }} | |
generateReleaseNotes: true | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: "./builds/*" |