Bump version from 0.1.5 to 0.1.6 #51
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: export layer | |
| on: | |
| push: | |
| tags: | |
| - '**' | |
| env: | |
| registry: https://registry.oomol.com | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| package: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| name: ${{ steps.get_name.outputs.name }} | |
| version: ${{ steps.get_version.outputs.version }} | |
| is-publish: ${{ steps.is_publish.outputs.result }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get name | |
| id: get_name | |
| run: | | |
| if [ -f package.oo.yaml ]; then | |
| name=$(yq eval '.name' package.oo.yaml) | |
| echo "name=$name" >> "$GITHUB_OUTPUT" | |
| elif [ -f package.oo.yml ]; then | |
| name=$(yq eval '.name' package.oo.yml) | |
| echo "name=$name" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "No valid package file found" | |
| exit 1 | |
| fi | |
| - name: Get version | |
| id: get_version | |
| run: | | |
| if [ -f package.oo.yaml ]; then | |
| version=$(yq eval '.version' package.oo.yaml) | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| elif [ -f package.oo.yml ]; then | |
| version=$(yq eval '.version' package.oo.yml) | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "No valid package file found" | |
| exit 1 | |
| fi | |
| - name: publish | |
| id: is_publish | |
| run: | | |
| http_status=$(curl -s -o /dev/null -w "%{http_code}" "${{env.registry}}/-/oomol/detail/${{ steps.get_name.outputs.name }}/${{ steps.get_version.outputs.version }}") | |
| if [ "$http_status" -eq 404 ]; then | |
| echo "Package not found, proceeding to publish." | |
| echo "result=false" >> "$GITHUB_OUTPUT" | |
| elif [ "$http_status" -eq 200 ]; then | |
| echo "Package already exists (HTTP status: $http_status), skipping publish." | |
| echo "result=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "Error checking package existence (HTTP status: $http_status). Assuming it doesn't exist." | |
| exit 1 | |
| fi | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: [package] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| if: needs.package.outputs.is-publish == 'false' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| if: needs.package.outputs.is-publish == 'false' | |
| - name: Install oopm | |
| run: npm install -g oopm | |
| if: needs.package.outputs.is-publish == 'false' | |
| - name: Publish OOMOL Package | |
| uses: oomol-lab/oopm-publish-action@main | |
| if: needs.package.outputs.is-publish == 'false' |