Skip to content

Commit

Permalink
Update CI/CD Workflow for XML File Handling
Browse files Browse the repository at this point in the history
This commit updates the GitHub Actions workflow for the ATAK-Maps project. The key changes include:

- Modified the 'Get Date' step to use the new syntax for setting environment variables, replacing the deprecated '::set-output' command.
- Adjusted the 'Generate release notes' step to fetch the complete git history for accurate log generation and updated the syntax for setting environment variables.
- Ensured the use of the 'env.date' environment variable throughout the workflow for consistency and adherence to GitHub Actions standards.

These changes improve the workflow's compliance with current GitHub Actions best practices and ensure the reliable generation of release notes and date-stamped zip files for XML updates.
  • Loading branch information
joshuafuller authored Jan 2, 2024
1 parent 40fb652 commit b37d076
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/zip_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI/CD Pipeline for ATAK-Maps
on:
push:
branches:
- feature/ci-cd-automation # This workflow will run only on pushes to this branch
- feature/ci-cd-automation
paths:
- '**/*.xml' # And only when there are changes in XML files
- '**/*.xml'

jobs:
build-and-release:
Expand All @@ -15,29 +15,25 @@ jobs:
uses: actions/checkout@v2

- name: Get Date
id: date
run: echo "::set-output name=date::$(date +'%m-%d-%Y')"
run: |
echo "date=$(date +'%m-%d-%Y')" >> $GITHUB_ENV # Adjusted for new syntax
- name: Zip the updated XML files
run: zip -r ATAK-Maps-${{ steps.date.outputs.date }}.zip . -i \*.xml
run: zip -r ATAK-Maps-${{ env.date }}.zip . -i \*.xml # Using the new environment variable syntax

- name: Generate release notes
id: release_notes
run: |
echo "release_notes<<EOF" >> $GITHUB_ENV
git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 @^)..@ >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
git fetch --prune --unshallow # Ensuring complete git history for accurate logs
echo "release_notes=$(git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 @^)..@)" >> $GITHUB_ENV
- name: Create Draft Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: draft-release-${{ steps.date.outputs.date }}
release_name: Draft Release ${{ steps.date.outputs.date }}
tag_name: draft-release-${{ env.date }}
release_name: Draft Release ${{ env.date }}
body: ${{ env.release_notes }}
draft: true # This marks the release as a draft
draft: true
prerelease: false

- name: Upload Release Asset
Expand All @@ -46,6 +42,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ATAK-Maps-${{ steps.date.outputs.date }}.zip
asset_name: ATAK-Maps-${{ steps.date.outputs.date }}.zip
asset_path: ./ATAK-Maps-${{ env.date }}.zip
asset_name: ATAK-Maps-${{ env.date }}.zip
asset_content_type: application/zip

0 comments on commit b37d076

Please sign in to comment.